From 389b519f4b2227847aa4ea449c155c532da43528 Mon Sep 17 00:00:00 2001 From: KharchenkoVladimir Date: Tue, 23 Nov 2021 11:31:47 +0500 Subject: [PATCH] CS2-107: Small guard fix for default result of DB query --- ...WellOperationsStatService.cs => IOperationsStatService.cs} | 4 +++- .../Services/WellOperationService/OperationsStatService.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) rename AsbCloudApp/Services/{IWellOperationsStatService.cs => IOperationsStatService.cs} (72%) diff --git a/AsbCloudApp/Services/IWellOperationsStatService.cs b/AsbCloudApp/Services/IOperationsStatService.cs similarity index 72% rename from AsbCloudApp/Services/IWellOperationsStatService.cs rename to AsbCloudApp/Services/IOperationsStatService.cs index dc71fb33..d0689b9e 100644 --- a/AsbCloudApp/Services/IWellOperationsStatService.cs +++ b/AsbCloudApp/Services/IOperationsStatService.cs @@ -5,8 +5,10 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { - public interface IWellOperationsStatService + public interface IOperationsStatService { + Task GetRopStatByIdWellAsync(int idWell, CancellationToken token); + Task GetRopStatByUidAsync(string uid, CancellationToken token); Task GetStatClusterAsync(int idCluster, int idCompany, CancellationToken token = default); Task GetStatWellAsync(int idWell, CancellationToken token = default); Task>> GetTvdAsync(int idWell, CancellationToken token); diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index 45cc8212..5f20c8ac 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -129,6 +129,9 @@ namespace AsbCloudInfrastructure.Services.WellOperationService .LastOrDefaultAsync(token) .ConfigureAwait(false); + if (idLastSectionType == default) + return null; + var operations = await (from o in db.WellOperations where clusterWellsIds.Contains(o.IdWell) && o.IdType == 1 &&