fix AsbCloudWebApi.Controllers.WellOperationController.ExportAsync. NullRef in WellService.Convert().

This commit is contained in:
Фролов 2021-11-22 14:14:44 +05:00
parent 809ee137aa
commit 0b66648267
2 changed files with 4 additions and 3 deletions

View File

@ -110,6 +110,7 @@ namespace AsbCloudInfrastructure.Services
return dto; return dto;
} }
public async Task<string> GetWellCaptionByIdAsync(int idWell, CancellationToken token) public async Task<string> GetWellCaptionByIdAsync(int idWell, CancellationToken token)
{ {
var entity = await cacheWells.FirstOrDefaultAsync(w => w.Id == idWell, token).ConfigureAwait(false); var entity = await cacheWells.FirstOrDefaultAsync(w => w.Id == idWell, token).ConfigureAwait(false);
@ -144,8 +145,8 @@ namespace AsbCloudInfrastructure.Services
{ {
Id = well.Id, Id = well.Id,
Caption = well.Caption, Caption = well.Caption,
Cluster = well.Cluster.Caption, Cluster = well.Cluster?.Caption,
Deposit = well.Cluster.Deposit.Caption, Deposit = well.Cluster?.Deposit?.Caption,
LastTelemetryDate = GetLastTelemetryDate(well.Id), LastTelemetryDate = GetLastTelemetryDate(well.Id),
IdWellType = well.IdWellType ?? default, IdWellType = well.IdWellType ?? default,
IdState = well.IdState, IdState = well.IdState,

View File

@ -7,7 +7,7 @@
} }
}, },
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True", "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True",
"DebugConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True", "DebugConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True",
"ServerConnection": "Host=192.168.1.70;Database=postgres;Username=postgres;Password=q;Persist Security Info=True", "ServerConnection": "Host=192.168.1.70;Database=postgres;Username=postgres;Password=q;Persist Security Info=True",
"LocalConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True" "LocalConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True"