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)
.ConfigureAwait(false);
var dto = entity.Adapt<WellDto>();
if (entity is null)
return null;
if (dto is null)
return dto;
var dto = entity.Adapt<WellDto>();
dto.Cluster = entity.Cluster?.Caption;
dto.Deposit = entity.Cluster?.Deposit?.Caption;