public ActionResult Edit(EasyBooks.Domain.Book book) { if (ModelState.IsValid) { var service = IoC.Resolve <IBookService>(); if (book.ID != 0) { service.Save(book.ID, book); } else { service.InsertBook(book); } return(RedirectToAction("Index")); } else { return(View(book)); } }
public void Save(long id, Book book) { _repository.Save(id, book); }
public void InsertBook(Book book) { _repository.Create(book); }