Ejemplo n.º 1
0
        public async Task <IActionResult> ImportAsync(IFormFile file)
        {
            try
            {
                if (file == null)
                {
                    return(BadRequest("Please attach the file."));
                }

                var result = await _airportService.ImportFile(file);

                return(Ok("Successfully imported rows: " + result.SuccessfullyImportedRows + ", skipped rows: " + result.SkippedRows));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }