Пример #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var clientTask = repository.GetClients(id.GetValueOrDefault());

            var clientScopeTask = repository.GetClientScopes(clientId: id.GetValueOrDefault());

            await Task.WhenAll(clientTask, clientScopeTask)
            .ConfigureAwait(false);

            Client = clientTask.Result.FirstOrDefault();

            if (Client == null)
            {
                return(NotFound());
            }

            Client.Scopes = clientScopeTask.Result;

            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var response = await repository.GetClients(id.GetValueOrDefault())
                           .ConfigureAwait(false);

            Client = response.FirstOrDefault();

            if (Client == default)
            {
                return(NotFound());
            }

            return(Page());
        }