public async Task <IActionResult> Edit(PersonEditViewModel model) { if (ModelState.IsValid) { try { var path = model.ImageUrl; if (model.ImageFile != null) { path = await _imageHelper.UploadImageAsync(model.ImageFile, "People"); } var admin = _converterHelper.ToAdminEdit(model, path); await _adminRepository.UpdateAsync(admin); ViewBag.UserMessage = "User Sucessfully Updated!"; } catch (DbUpdateConcurrencyException) { if (!await _adminRepository.ExistAsync(model.Id)) { return(NotFound()); } else { throw; } } return(View(model)); } return(View(model)); }