Skip to content

Commit

Permalink
#3250 Import device list using the template given
Browse files Browse the repository at this point in the history
  • Loading branch information
E068097 committed Nov 12, 2024
1 parent 6d24d4e commit 150c907
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void AddNewDevice(DeviceListItem device)
{
var layer = layers.FirstOrDefault(layer => layer.Id == device.LayerId);

if (layer?.Planning != "None")
if (layer?.Planning is not "None" and not null)
{
// If the layer linked to a device already has a planning, add the device to the planning list
foreach (var planning in this.planningCommands.Where(planning => planning.planningId == layer.Planning))
Expand Down
4 changes: 2 additions & 2 deletions src/IoTHub.Portal.Server/Managers/ExportManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task ExportDeviceList(Stream stream)

using var writer = new StreamWriter(stream, Encoding.UTF8, leaveOpen: true);

using var csvWriter = new CsvWriter(writer, CultureInfo.CurrentCulture, leaveOpen: true);
using var csvWriter = new CsvWriter(writer, CultureInfo.InvariantCulture, leaveOpen: true);

WriteHeader(tags, properties, csvWriter);

Expand Down Expand Up @@ -80,7 +80,7 @@ public async Task ExportTemplateFile(Stream stream)

using var writer = new StreamWriter(stream, Encoding.UTF8, leaveOpen: true);

using var csvWriter = new CsvWriter(writer, CultureInfo.CurrentCulture, leaveOpen: true);
using var csvWriter = new CsvWriter(writer, CultureInfo.InvariantCulture, leaveOpen: true);

WriteHeader(tags, properties, csvWriter);

Expand Down

0 comments on commit 150c907

Please sign in to comment.