예제 #1
0
 public ActionResult New(NewBookViewModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.Save(_bookRepository))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
         }
     }
     return(View(model));
 }