public IActionResult Edit(Person person) { if (ModelState.IsValid) { _personRepo.Edit(person); return(RedirectToAction("list")); } return(View()); }
public IHttpActionResult Edit(int id, PersonViewModel personViewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var updatePerson = _personRepo.Edit(id, personViewModel); return(Ok(updatePerson)); }