CS2-107: Small guard fix for default result of DB query

This commit is contained in:
KharchenkoVladimir 2021-11-23 11:31:47 +05:00
parent d361c9a9b4
commit 389b519f4b
2 changed files with 6 additions and 1 deletions

View File

@ -5,8 +5,10 @@ using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
public interface IWellOperationsStatService
public interface IOperationsStatService
{
Task<ClusterRopStatDto> GetRopStatByIdWellAsync(int idWell, CancellationToken token);
Task<ClusterRopStatDto> GetRopStatByUidAsync(string uid, CancellationToken token);
Task<StatClusterDto> GetStatClusterAsync(int idCluster, int idCompany, CancellationToken token = default);
Task<StatWellDto> GetStatWellAsync(int idWell, CancellationToken token = default);
Task<IEnumerable<PlanFactPredictBase<WellOperationDto>>> GetTvdAsync(int idWell, CancellationToken token);

View File

@ -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 &&