From ef8d559739831af741b867797926971c62bc492f Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Wed, 17 Apr 2024 16:17:52 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B2=D1=8C=D1=8E-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/WellCompositeOperationSourceDto.cs | 2 +- .../Services/WellCompositeOperationService.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AsbCloudApp/Data/WellCompositeOperationSourceDto.cs b/AsbCloudApp/Data/WellCompositeOperationSourceDto.cs index fd5d819c..04ec7b3b 100644 --- a/AsbCloudApp/Data/WellCompositeOperationSourceDto.cs +++ b/AsbCloudApp/Data/WellCompositeOperationSourceDto.cs @@ -11,7 +11,7 @@ namespace AsbCloudApp.Data /// /// Скважина /// - public WellDto Well { get; set; } = new(); + public WellDto Well { get; set; } = null!; /// /// Операции по скважине diff --git a/AsbCloudInfrastructure/Services/WellCompositeOperationService.cs b/AsbCloudInfrastructure/Services/WellCompositeOperationService.cs index 2a4d0330..783228c3 100644 --- a/AsbCloudInfrastructure/Services/WellCompositeOperationService.cs +++ b/AsbCloudInfrastructure/Services/WellCompositeOperationService.cs @@ -147,7 +147,7 @@ namespace AsbCloudInfrastructure.Services var categoriesDict = categories.ToDictionary(s => s.Id, s => s.Name); var wells = await wellService.GetAsync(new WellRequest { Ids = idsWells }, token); - var wellsDict = wells.ToDictionary(w => w.Id, w => w.Caption); + var wellsDict = wells.ToDictionary(w => w.Id); var idsWellSectionTypes = WellSectionTypesWithCategories.Select(t => t.IdSectionType).Distinct(); var usedCategories = WellSectionTypesWithCategories.Select(c => c.IdCategory).Distinct(); @@ -215,7 +215,7 @@ namespace AsbCloudInfrastructure.Services Well = new WellDto() { Id = o.Key, - Caption = wellsDict.TryGetValue(o.Key, out string? caption) ? caption : string.Empty, + Caption = wellsDict[o.Key].Caption, } });