public ActionResult Create(Session session) { if (ModelState.IsValid) { ds.Create(session); return RedirectToAction("Index"); } return View(session); }
// Method for updating sessions public void Update(Session item) { dc.Entry(item).State = EntityState.Modified; dc.SaveChanges(); }
// Method for creating sessions public void Create(Session session) { dc.Sessions.Add(session); dc.SaveChanges(); }