public IActionResult OnPost(int movieId) { Movie = _movieData.Delete(movieId); _movieData.Commit(); if (Movie == null) { return(RedirectToPage("./NotFound")); } return(RedirectToPage("./List")); }
public IActionResult OnPost(int movieId) { var movie = movieData.Delete(movieId); movieData.Commit(); if (movie == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{movie.Name} deleted"; return(RedirectToPage("./Index")); }
public IActionResult OnPost(int movieId) { var movie = _movieData.Delete(movieId); if (movie is null) { return(RedirectToPage("./NotFound")); } _movieData.Commit(); TempData["Message"] = $"{movie.Title} deleted"; return(RedirectToPage("./List")); }
public ActionResult Delete(int id, IFormCollection form) { db.Delete(id); TempData["Message"] = "You have deleted the movie!"; return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { movieData.Delete(id); movieData.Commit(); return(NoContent()); }
public ActionResult DeleteConfirmed(int id) { _db.Delete(id); return(RedirectToAction("Index")); }
public void Delete(int id) { _movieData.Delete(id); }
public IActionResult OnPost(int id) { movieData.Delete(id); TempData["ActionMessage"] = "Deleted a movie"; return(RedirectToPage("./List")); }