コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
 public IHttpActionResult Put(List <EditionDto> list)
 {
     return(Ok(_service.Update(list)));
 }
コード例 #4
0
 public Core.Dto.Edition Put(Core.Dto.Edition edition)
 {
     return(_editionService.Update(edition));
 }