public async Task <ActionResult> EditPatient(Patient model, List <IFormFile> files) { if (ModelState.IsValid) { try { await _patient.Edit(model, files); TempData["success"] = "Patient Info Edited Successfully"; return(RedirectToAction("EditPatient")); } catch (DbUpdateConcurrencyException) { if (!PatientExists(model.Id)) { return(NotFound()); } else { throw; } } } TempData["error"] = "Unable to edit Patient Info"; ViewData["BloodGroupId"] = new SelectList(_context.BloodGroup, "Id", "Name", model.BloodGroupId); return(View(model)); }