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, } });