public IActionResult Index(IFormFile[] files) { IEnumerable <IFormFile> csvFiles = files.Where(file => Path.GetExtension(file.FileName) == ".csv"); var model = new FilesProcessingViewModel(); if (csvFiles.Any()) { using (var processor = new CsvProcessor(_context, _logger)) { var filesForProcessing = csvFiles.Select(formFile => new InputFile { FileName = formFile.FileName, OpenStream = formFile.OpenReadStream }); model.Result = processor.ProcessFiles(filesForProcessing); } } else { model.Result = "There isn't csv-files"; } return(View("FilesProcessing", model)); }