From e0a453a1f6a3f482373e3a26d7a9742ca2777110 Mon Sep 17 00:00:00 2001 From: KharchenkoVladimir Date: Tue, 23 Nov 2021 11:41:27 +0500 Subject: [PATCH] CS2-107: Added lost data after merge conflict resolve (with dev) --- AsbCloudInfrastructure/Services/WellService.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index f34d68a6..39c52770 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -138,6 +138,20 @@ namespace AsbCloudInfrastructure.Services _ => "Незвестно", }; } + + public async Task> GetClusterWellsIdsAsync(int idWell, CancellationToken token) + { + var well = await cacheWells.FirstOrDefaultAsync(w => w.Id == idWell) + .ConfigureAwait(false); + + if (well is null) + return null; + + var clusterWells = await cacheWells.WhereAsync(w => w.IdCluster == well.IdCluster) + .ConfigureAwait(false); + + return clusterWells.Select(w => w.Id); + } private WellDto Convert(Well well) { @@ -145,6 +159,7 @@ namespace AsbCloudInfrastructure.Services { Id = well.Id, Caption = well.Caption, + IdCluster = well.IdCluster, Cluster = well.Cluster?.Caption, Deposit = well.Cluster?.Deposit?.Caption, LastTelemetryDate = GetLastTelemetryDate(well.Id),