コード例 #1
0
        public IEnumerable <Comment> Query(CommentSpecifications specifications)
        {
            if (specifications == null)
            {
                return(null);
            }

            var result = _commentsProvider.GetAll(specifications.NewsId);

            if (specifications.CommentId.HasValue)
            {
                result = result.Where(w => w.Id == specifications.CommentId);
            }

            return(result);
        }
コード例 #2
0
 public async Task <IEnumerable <Comment> > QueryAsync(CommentSpecifications specifications)
 {
     return(await Task.Run(() => Query(specifications)));
 }