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