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