GetFileName -> async

This commit is contained in:
eugeniy_ivanov 2023-01-12 09:40:37 +05:00
parent 0b3825a531
commit e950f40122
3 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ namespace AsbCloudApp.Services
/// Получить имя файла (исходя из названия скважины)
/// </summary>
/// <returns></returns>
string GetFileNameAsync(int idWell, CancellationToken token);
Task<string> GetFileNameAsync(int idWell, CancellationToken token);
/// <summary>
/// загрузить текущую плановую траекторию в .xlsx

View File

@ -56,9 +56,9 @@ namespace AsbCloudInfrastructure.Services.PlannedTrajectory
return stream;
}
public string GetFileNameAsync (int idWell, CancellationToken token)
public async Task<string> GetFileNameAsync (int idWell, CancellationToken token)
{
var fileName = wellService.GetWellCaptionByIdAsync(idWell, token) + "_plannedTrajectory.xlsx";
var fileName = await wellService.GetWellCaptionByIdAsync(idWell, token) + "_plannedTrajectory.xlsx";
return fileName;
}

View File

@ -61,7 +61,7 @@ namespace AsbCloudWebApi.Controllers
token).ConfigureAwait(false))
return Forbid();
var stream = await plannedTrajectoryImportService.ExportAsync(idWell, token);
var fileName = plannedTrajectoryImportService.GetFileNameAsync(idWell, token);
var fileName = plannedTrajectoryImportService.GetFileNameAsync(idWell, token).Result.ToString();
return File(stream, "application/octet-stream", fileName);
}