public async Task <int> CountCategories(string phrase, int sortType) { var searcher = new CategorySearchHelper(_context); return(await searcher .Active() .IncludeCountPublic() .Like(phrase) .Count()); }
public async Task <ICollection <Category> > SearchCategories() { var searcher = new CategorySearchHelper(_context); return(await searcher .Active() .IncludeCountPublic() .SortBy(Consts.SortType.Popularity) .Get()); }
public async Task <ICollection <Category> > SearchTopCategories(int top) { var searcher = new CategorySearchHelper(_context); var col = await searcher .Active() .IncludeCountPublic() .Get(); return(col.OrderByDescending(c => c.ProductCount).Where(c => c.ProductCount > 0).Take(top).ToList()); }
public async Task <ICollection <Category> > SearchCategories(string phrase, int sortType, int page, int pageSize) { var searcher = new CategorySearchHelper(_context); return(await searcher .Active() .IncludeCountPublic() .Like(phrase) .SortBy((Consts.SortType)sortType) .Page(page, pageSize) .Get()); }
public async Task <ICollection <Category> > GetCategoryDistribution() { var catHelper = new CategorySearchHelper(_context); return(await catHelper.Active().IncludeCountHidden().Get()); }