Exemplo n.º 1
0
 public async Task <IActionResult> Post(IFormFile file)
 {
     try
     {
         return(await _importService.ImportFile(file)
                .OnFailure(errorMessage => _logger.LogError(errorMessage))
                .UnwrapOrThrow($"Unable to import file {file.FileName}"));
     }
     catch (Exception e)
     {
         _logger.LogError(e.StackTrace);
         return(BadRequestWithError(e));
     }
 }