public async Task <IActionResult> Get(string filename, bool headerOnFirstRow, string separator) { var activity = new Activity("ImportFile"); _logger.LogTrace($"start Import file {filename}"); IActionResult result = null; try { if (_diagnosticSource?.IsEnabled(activity.OperationName) == true) { _diagnosticSource.StartActivity(activity, 1); } if (string.IsNullOrEmpty(filename)) { return(BadRequest("filename is null")); } result = (await _storageService.DownloadFile(filename, headerOnFirstRow, separator)) ? Ok() : (IActionResult)BadRequest(); if (_diagnosticSource?.IsEnabled(activity.OperationName) == true) { _diagnosticSource.StopActivity(activity, 1); } } catch (Exception exception) { _logger.LogError($"can not import file {exception}"); } _logger.LogTrace($"end Import file {filename}"); return(result); }