public ActionResult Edit(int id, EditionViewModel model) { if (ModelState.IsValid) { Editions editionToUpdate = new Editions(); editionToUpdate.InjectFrom(model); var createNewEdition = editions.Update(editionToUpdate); return(RedirectToAction(nameof(Index))); } else { return(View(model)); } }
public ActionResult Edit(int id, EditionViewModel model) { if (ModelState.IsValid) { Editions editionToUpdate = new Editions(); editionToUpdate.InjectFrom(model); var createNewEdition = editions.Update(editionToUpdate); if (createNewEdition == null) { ModelState.AddModelError("Name", "The Name must be unique!"); return(View(model)); } return(RedirectToAction(nameof(Index))); } else { return(View(model)); } }
public IHttpActionResult Put(List <EditionDto> list) { return(Ok(_service.Update(list))); }
public Core.Dto.Edition Put(Core.Dto.Edition edition) { return(_editionService.Update(edition)); }