public override async Task <IEnumerable <Tuple <ApiClient, ApiThrottlePolicy, Domain.Models.ApiPermissionSet> > > ExecuteAsync()
        {
            var output = new List <Tuple <ApiClient, ApiThrottlePolicy, Domain.Models.ApiPermissionSet> >();

            using (var repo = new Repository(User))
            {
                var keys = repo.GetApiKeys(UserName);
                foreach (var key in keys)
                {
                    ApiThrottlePolicy policy             = null;
                    Domain.Models.ApiPermissionSet perms = null;
                    if (key.ApiThrottlePolicyID.HasValue)
                    {
                        var q = new QueryApiThrottlePolicy(key.ApiThrottlePolicyID.Value);
                        policy = await q.ExecuteAsync().ConfigureAwait(CONSTANTS.AWAIT_CAPTURE_CONTEXT);
                    }
                    var p = new QueryApiPermissionSet(key.ApiPermissionPolicyID);
                    perms = await p.ExecuteAsync().ConfigureAwait(CONSTANTS.AWAIT_CAPTURE_CONTEXT);

                    var tuple = Tuple.Create(key, policy, perms);
                    output.Add(tuple);
                }
            }
            return(output);
        }
Beispiel #2
0
        public override async Task <IEnumerable <Tuple <ApiClient, ApiThrottlePolicy> > > ExecuteAsync()
        {
            var output = new List <Tuple <ApiClient, ApiThrottlePolicy> >();

            using (var repo = new Repository())
            {
                var keys = repo.GetApiKeys(UserName);
                foreach (var key in keys)
                {
                    ApiThrottlePolicy policy = null;
                    if (key.ApiThrottlePolicyID.HasValue)
                    {
                        var q = new QueryApiThrottlePolicy(key.ApiThrottlePolicyID.Value);
                        policy = await q.ExecuteAsync();
                    }

                    var tuple = new Tuple <ApiClient, ApiThrottlePolicy>(key, policy);
                    output.Add(tuple);
                }
            }
            return(output);
        }