public IActionResult OnPost() { if (!service.ExistsMovie(this.Id)) { return(RedirectToPage("./Index")); } service.DeleteMovie(this.Id); return(RedirectToPage("./Index")); }
public IActionResult OnGetDeleteMovie(int id) { if (!service.ExistsMovie(id)) { return(RedirectToPage("./Index")); } service.DeleteMovie(id); return(RedirectToPage("./Index")); }