public IActionResult DeleteConfirmed(int id) { var film = _filmRepo.Find(f => f.Id == id).FirstOrDefault(); _filmRepo.Delete(film); _filmRepo.Save(); return(RedirectToAction(nameof(Index))); }
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); }