public async Task <IActionResult> Create(ReportViewModel reportViewModel, CancellationToken cancellationToken) { if (!this.ModelState.IsValid) { return(this.View()); } if (reportViewModel.File == null) { this.ModelState.AddModelError(string.Empty, "Please upload .pdf file"); return(this.View()); } else if (reportViewModel.File.ContentType != "application/pdf") { this.ModelState.AddModelError(string.Empty, "Please upload .pdf file"); return(this.View()); } var report = await this.reportService.AddAsync(reportViewModel.ToServiceModel(), cancellationToken); await this.uploadedFileService.AddAsync(reportViewModel.File, report.Id, cancellationToken); return(RedirectToAction(nameof(Index))); }