public int UpdateTown(TownModel townModel) { try { return(townRepository.UpdateTown(townModel)); } catch (Exception ex) { throw ex; } }
public ActionResult Edit(Town town) { if (!IsTownNameValid(town.TownName)) { return(RedirectToAction("Index")); } if (ModelState.IsValid) { townRepository.UpdateTown(town); townRepository.Save(); return(RedirectToAction("Index")); } return(View(town)); }
public async Task <TownDto> UpdateTown(TownDto townUpdateDto) { TownDto updatedTown = await _townRepository.UpdateTown(townUpdateDto); return(updatedTown); }