public void CreateBook(BookBusinessModel book) { var mapper = new BookMapper(); var bookNew = mapper.Map(book); this.uow.Items.Add(bookNew); this.uow.Commit(); book.Id = bookNew.Id; // updates the book.Id to Id value from DB }
public ActionResult Edit_old(BookBusinessModel viewModel) { if (ModelState.IsValid) { this.bookInfoManager.UpdateBook(viewModel); return RedirectToAction("Details", new { id = viewModel.Id }); } return View(viewModel); }
public void UpdateBook(BookBusinessModel book) { var mapper = new BookMapper(); this.uow.Items.Update(mapper.Map(book)); this.uow.Commit(); }