Пример #1
0
 public async Task<long> CountAsync(string requesterId, string feedOwnerId, ITentFeedRequest feedRequest, CancellationToken cancellationToken = new CancellationToken())
 {
     // Build and run the query using the provided Feed Request.
     var tableQuery = await feedRequest.AsCountTableQueryAsync(this.db.R, this.table, requesterId, feedOwnerId, cancellationToken);
     return await this.db.Run(c => tableQuery
         .Count()
         .RunResultAsync<long>(c, null, cancellationToken), cancellationToken);
 }
Пример #2
0
        public async Task<IList<UserPost>> GetAsync(string requesterId, string feedOwnerId, ITentFeedRequest feedRequest, CancellationToken cancellationToken = new CancellationToken())
        {
            // Build and run the query using the provided Feed Request.
            var tableQuery = await feedRequest.AsTableQueryAsync(this.db.R, this.table, requesterId, feedOwnerId, cancellationToken);
            var results = await this.db.Run(c => tableQuery
                .RunResultAsync<IList<UserPost>>(c, null, cancellationToken), cancellationToken);

            // Filter the results and return.
            return results.Where(p => p != null).ToList();
        }