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