public ActionResult Create(Article article) { if (ModelState.IsValid) { db.Articles.Add(article); db.SaveChanges(); return RedirectToAction("Index"); } return View(article); }
public ActionResult Edit(Article article) { if (ModelState.IsValid) { db.Entry(article).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(article); }