public static Task <IEnumerable <User> > GetAllAsync(this IUserManager userManager, Action <GetAllUserOptions> configureOptions)
        {
            var options = new GetAllUserOptions();

            configureOptions(options);

            return(userManager.GetAllAsync(options));
        }
        public async Task <IEnumerable <User> > GetAllAsync(GetAllUserOptions options)
        {
            var uri = GetUserManagementUri(options.AuthenticationDomain);

            Logger.LogInformation($"Attempting to get all users - {uri}");

            try
            {
                var result = await _client.GetAsync(uri, options.CancellationToken).ConfigureAwait(false);

                result.EnsureSuccessStatusCode();

                var content = await result.Content.ReadAsStringAsync().ConfigureAwait(false);

                return(JsonConvert.DeserializeObject <List <User> >(content));
            }
            catch (Exception exception)
            {
                Logger.LogError(exception, $"Error trying to get all users - {uri}");
                throw;
            }
        }