public ActionResult Create(Blog blog) { if (ModelState.IsValid) { repo.Insert(blog); repo.Save(); return RedirectToAction("Index"); } return View(blog); }
public void Update(Blog obj) { db.Entry(obj).State = EntityState.Modified; }
public ActionResult Edit(Blog blog) { if (ModelState.IsValid) { repo.Update(blog); repo.Save(); return RedirectToAction("Index"); } return View(blog); }
public void Insert(Blog obj) { db.Blogs.Add(obj); }