public async Task <IActionResult> OnPostDeleteAsync() { var success = await _context.DeleteAssignmentAsync(Assignment.AssignmentID); return(success ? RedirectToPage("/Sessions/Details", new { id = Assignment.SessionID }) : RedirectToPage("/Error")); }