public IEnumerable <Coffee> GetCoffees(IRepositoryFilter filter, int count = 0) { return(CoffeeProvider.GetCoffees() .LatestVersion(mLatestVersionEnabled) .Published(!mLatestVersionEnabled) .OnSite(AppConfig.SiteName) .Culture(mCultureName) .CombineWithDefaultCulture() .TopN(count) .WhereTrue("SKUEnabled") .Where(filter?.GetWhereCondition()) .OrderByDescending("SKUInStoreFrom") .ToList()); }
private List <SearchResultDto> GetCoffeeQuery() { return(CoffeeProvider.GetCoffees() .OrderBy("NodeOrder") .AsEnumerable() .Select(x => { return new SearchResultDto() { Image = ValidationHelper.GetString(x.GetValue("SKUImagePath"), string.Empty), Date = ValidationHelper.GetDateTime(x.GetValue("DocumentCreatedWhen"), DateTime.MinValue), Content = ValidationHelper.GetString(x.GetValue("DocumentContent"), string.Empty), Title = ValidationHelper.GetString(x.GetValue("DocumentName"), string.Empty), Price = ValidationHelper.GetDouble(x.GetValue("SKUPrice"), 0.00), Type = ValidationHelper.GetString(x.GetValue("ClassName"), string.Empty).Replace('.', '-') }; }) .ToList()); }