in sample-applications/frontend-mvc/ContainerMVC/Controllers/HomeController.cs [112:128]
public ActionResult EditBook(int id)
{
var book = bookDB.Books.Find(id);
TryUpdateModelAsync<Book>(book).Wait();
try
{
bookDB.SaveChanges();
return RedirectToAction("Books");
}
catch (Exception ex)
{
ModelState.AddModelError("Update", string.Format("Unable to save changes. Try again, and if the problem persists, see your system administrator.Exception : {0}", ex.Message));
}
return View(book);
}