public ActionResult AddFromTxt(TxtFile model) { if (ModelState.IsValid) { using (var db = new DomainContext()) { var result = db.Auditories.AddListFromTxt(model.Txt); db.SaveChanges(); ViewBag.Result = result; return View(); } } return View(model); }
public ActionResult Create(Lector lector) { if (ModelState.IsValid) { using (var db = new DomainContext()) { db.Lectors.Add(lector); db.SaveChanges(); return RedirectToAction("Index"); } } return View(lector); }
public ActionResult DeleteConfirmed(int id) { using (var db = new DomainContext()) { db.Lectors.Remove(id); db.SaveChanges(); return RedirectToAction("Index"); } }