public ActionResult Content(ContentAdminModel model) { if (ModelState.IsValid) { using (var db = new DataDBContext()) { var target = db.Items.Find(model.ContentId); target.Content01 = model.Body; db.SaveChanges(); } } return View(model); }
public ActionResult About() { var model = new ContentAdminModel(); using (var db = new DataDBContext()) { var about = db.Items.Find("795D793B-2F0B-47C2-A22E-C9AC099DDDAF"); model.ContentId = about.ItemId; model.Body = about.Content01; } return View(model); }