public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var resp = await repository.GetApiResources(id.GetValueOrDefault()) .ConfigureAwait(false); Api = resp.FirstOrDefault(); if (Api == null) { return(NotFound()); } return(Page()); }
public async Task<IActionResult> OnGetAsync(int? id) { if (id == null) { return NotFound(); } var apiTask = repository.GetApiResources(id.GetValueOrDefault()); var apiScopeTask = repository.GetApiScopes(apiResourceId: id.GetValueOrDefault()); await Task.WhenAll(apiTask, apiScopeTask) .ConfigureAwait(false); Api = apiTask.Result.FirstOrDefault(); if (Api == null) { return NotFound(); } Api.Scopes = apiScopeTask.Result; return Page(); }