public ActionResult Create(Assignment assignment) { if (ModelState.IsValid) { ds.Create(assignment); return RedirectToAction("Index"); } return View(assignment); }
// Method for updating assignments public void Update(Assignment assignment) { dc.Entry(assignment).State = EntityState.Modified; dc.SaveChanges(); }
// Method for creating assignments public void Create(Assignment assignment) { dc.Assignments.Add(assignment); dc.SaveChanges(); }