예제 #1
0
        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"));
        }
예제 #2
0
 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());
     }
 }