Exemple #1
0
        public IActionResult DeleteConfirmed(int id)
        {
            var film = _filmRepo.Find(f => f.Id == id).FirstOrDefault();

            _filmRepo.Delete(film);
            _filmRepo.Save();
            return(RedirectToAction(nameof(Index)));
        }
Exemple #2
0
        public ActionResult <Film> DeleteFilm(int id)
        {
            var film = _filmRepo.Find(f => f.Id == id).FirstOrDefault();

            if (film == null)
            {
                return(NotFound());
            }

            _filmRepo.Delete(film);
            _filmRepo.Save();

            return(film);
        }