public ActionResult Delete(Models.Filmy movieToDelete) { var SelMovie = (from Filmy in _db.Filmy where Filmy.ID == movieToDelete.ID select Filmy).First(); _db.Filmy.Remove(SelMovie); _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(Models.Filmy nwMovie) { if (ModelState.IsValid) { Models.Filmy nowy = nwMovie; _db.Filmy.Add(nowy); _db.SaveChanges(); return(RedirectToAction("Index")); } else { return(View()); } }