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