public ActionResult Edit([Bind(Include = "Id,Name")] BookElementViewModel bookElementViewModel) { if (ModelState.IsValid) { this.bookElementService.EditBookElement(Mapper.ToBookElement(bookElementViewModel)); return(RedirectToAction("Index")); } return(View(bookElementViewModel)); }
// GET: Categories/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IBookElementModel bookElementModel = this.bookElementService.FindById(id); IBookElementViewModel bookElementViewModel = new BookElementViewModel(bookElementModel); if (bookElementViewModel == null) { return(HttpNotFound()); } return(View(bookElementViewModel)); }