public IEnumerable <News> Query(NewsSpecifications specifications = null) { var result = _newsProvider.GetAll(); if (specifications == null) { return(result); } if (specifications.NewsId.HasValue) { result = result.Where(w => w.Id == specifications.NewsId); } return(result); }
public async Task <IEnumerable <News> > QueryAsync(NewsSpecifications specifications = null) { return(await Task.Run(() => Query(specifications))); }