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