// delete movie
        public IActionResult DeleteMovie(int movie_id)
        {
            MovieEntry movie = _context.Movies.Where(m => m.MovieEntryID == movie_id).FirstOrDefault();

            _context.Remove(movie);
            _context.SaveChanges();
            return(Redirect("/Home/EditMovie"));
        }
Example #2
0
 public IActionResult DeleteMovies(int id)
 {
     _context.Remove(_context.Movies.Single(x => x.MovieID == id));
     _context.SaveChanges();
     return(RedirectToAction("ViewMovies"));
 }