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