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