public ActionResult Create(Costume costume) { //Check if model is valid, then add Costume to table and save changes to Database if (ModelState.IsValid) { db.Costumes.Add(costume); db.SaveChanges(); return RedirectToAction("Index"); } return View(costume); }
public ActionResult Edit(Costume costume) { //Check if model is valid, then edit the data in the table and save changes to Database if (ModelState.IsValid) { db.Entry(costume).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(costume); }