public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } await repo.DeleteEventAsync(id); return(RedirectToPage("EventIndex", new { teamId = Event?.TeamId })); }