public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } MovieReviewComedy = await _context.MovieReviewComedy.FirstOrDefaultAsync(m => m.MovieReviewComedyId == id); if (MovieReviewComedy == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } MovieReviewComedy = await _context.MovieReviewComedy.FindAsync(id); if (MovieReviewComedy != null) { _context.MovieReviewComedy.Remove(MovieReviewComedy); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }