public ActionResult Edit(int id, WalkerFormViewModel vm) { try { _walkerRepo.UpdateWalker(vm.Walker); return(RedirectToAction(nameof(Index))); } catch { return(View(vm)); } }
public ActionResult Edit(int id, Walker walker) { try { _walkerRepo.UpdateWalker(walker); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { return(View(walker)); } }
public ActionResult Edit(int id, Walker walker) { try { // Create Edit Walker method to finish this _walkerRepo.UpdateWalker(walker); return(RedirectToAction(nameof(Index))); } catch { return(View(walker)); } }
public ActionResult Edit(int id, WalkerEditViewModel viewModel) { try { _walkerRepo.UpdateWalker(viewModel.Walker); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { viewModel.ErrorMessage = "There was an error editing the walker profile."; //viewModel.Neighborhood = _neighborhoodRepo.GetAll(); return(View(viewModel)); } }
public ActionResult Edit(int id, Walker walker) { try { _walkerRepo.UpdateWalker(walker); return(RedirectToAction("Index")); } catch (Exception) { WalkerFormModel vm = new WalkerFormModel() { Walker = walker, Neighborhoods = _neighborhoodRepo.GetAll() }; return(View(vm)); } }