Refactor WellService.GetAsync()

This commit is contained in:
Фролов 2021-10-20 17:56:36 +05:00
parent 8b54966876
commit 395d164c92

View File

@ -97,10 +97,10 @@ namespace AsbCloudInfrastructure.Services
.FirstOrDefaultAsync(w => w.Id == idWell, token) .FirstOrDefaultAsync(w => w.Id == idWell, token)
.ConfigureAwait(false); .ConfigureAwait(false);
var dto = entity.Adapt<WellDto>(); if (entity is null)
return null;
if (dto is null) var dto = entity.Adapt<WellDto>();
return dto;
dto.Cluster = entity.Cluster?.Caption; dto.Cluster = entity.Cluster?.Caption;
dto.Deposit = entity.Cluster?.Deposit?.Caption; dto.Deposit = entity.Cluster?.Deposit?.Caption;