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); }
public async Task <IEnumerable <Comment> > QueryAsync(CommentSpecifications specifications) { return(await Task.Run(() => Query(specifications))); }