diff --git a/src/IoTHub.Portal.Infrastructure/Jobs/SendPlanningCommandJob.cs b/src/IoTHub.Portal.Infrastructure/Jobs/SendPlanningCommandJob.cs index 2fb5bd82f..c24b40f49 100644 --- a/src/IoTHub.Portal.Infrastructure/Jobs/SendPlanningCommandJob.cs +++ b/src/IoTHub.Portal.Infrastructure/Jobs/SendPlanningCommandJob.cs @@ -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)) diff --git a/src/IoTHub.Portal.Server/Managers/ExportManager.cs b/src/IoTHub.Portal.Server/Managers/ExportManager.cs index c4895f403..16c63c4dc 100644 --- a/src/IoTHub.Portal.Server/Managers/ExportManager.cs +++ b/src/IoTHub.Portal.Server/Managers/ExportManager.cs @@ -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); @@ -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);