From 8af360f14f3b23d70708d355523437324895b73b Mon Sep 17 00:00:00 2001 From: delager Date: Fri, 2 Jun 2023 14:10:54 +0200 Subject: [PATCH] #2075 Fix GetByNameAsync --- .../Repositories/DeviceModelRepository.cs | 2 +- .../Repositories/EdgeDeviceModelRepository.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AzureIoTHub.Portal.Infrastructure/Repositories/DeviceModelRepository.cs b/src/AzureIoTHub.Portal.Infrastructure/Repositories/DeviceModelRepository.cs index ba9422e91..f1fb8ca13 100644 --- a/src/AzureIoTHub.Portal.Infrastructure/Repositories/DeviceModelRepository.cs +++ b/src/AzureIoTHub.Portal.Infrastructure/Repositories/DeviceModelRepository.cs @@ -16,7 +16,7 @@ public DeviceModelRepository(PortalDbContext context) : base(context) public async Task GetByNameAsync(string modelName) { return await this.context.Set() - .FirstOrDefaultAsync(deviceModel => deviceModel.Name.Equals(modelName, StringComparison.Ordinal)); + .FirstOrDefaultAsync(deviceModel => deviceModel.Name == modelName); } } } diff --git a/src/AzureIoTHub.Portal.Infrastructure/Repositories/EdgeDeviceModelRepository.cs b/src/AzureIoTHub.Portal.Infrastructure/Repositories/EdgeDeviceModelRepository.cs index 95e6b834f..76210805f 100644 --- a/src/AzureIoTHub.Portal.Infrastructure/Repositories/EdgeDeviceModelRepository.cs +++ b/src/AzureIoTHub.Portal.Infrastructure/Repositories/EdgeDeviceModelRepository.cs @@ -17,7 +17,7 @@ public EdgeDeviceModelRepository(PortalDbContext context) : base(context) public async Task GetByNameAsync(string edgeModelDevice) { return await this.context.Set() - .FirstOrDefaultAsync(edgeDeviceModel => edgeDeviceModel.Name.Equals(edgeModelDevice, StringComparison.Ordinal)); + .FirstOrDefaultAsync(edgeDeviceModel => edgeDeviceModel.Name == edgeModelDevice); } } }