public async Task <IActionResult> OnGetAsync(int?session_id) { if (session_id == null) { return(NotFound()); } SessionResponse = ApiClient.GetSessionResponseAsync(session_id.Value).Result; if (SessionResponse == null) { return(NotFound()); } conference = ApiClient.GetConferenceAsync(SessionResponse.ConferenceID).Result; if (conference == null) { return(NotFound()); } if (IdentityClient.GetUserOwnershipAsync(new UserOwnership { UserId = User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier).Value, ConferenceId = conference.ID }).Result == null) { return(base.NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?session_id) { if (session_id == null) { return(NotFound()); } conference = ApiClient.GetConferenceAsync(ApiClient.GetSessionResponseAsync(session_id.Value).Result.ConferenceID).Result; var result = ApiClient.DeleteSessionAsync(session_id.Value).Result; if (result == false) { return(RedirectToPage("/Error")); } return(RedirectToPage("/Conference/Index", new { conference_id = conference.ID })); }