Esempio n. 1
0
        /// <inheritdoc />
        public override async Task <ICollection <WebHook> > GetAllWebHooksAsync(string user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            user = NormalizeKey(user);

            CloudTable table = await _manager.GetCloudTableAsync(_options.ConnectionString, WebHookTable);

            TableQuery query = new TableQuery();

            _manager.AddPartitionKeyConstraint(query, user);

            IEnumerable <DynamicTableEntity> entities = await _manager.ExecuteQueryAsync(table, query);

            ICollection <WebHook> result = entities.Select(e => ConvertToWebHook(e))
                                           .Where(w => w != null)
                                           .ToArray();

            return(result);
        }