Example #1
0
        private static string CreateLimitFilterStringFromSearchRequest(SearchRequest searchRequest)
        {
            IEnumerable <IGrouping <FilterCategoryId, Filter> > queryFiltersByCategory =
                from f in searchRequest.GetActiveFilters()
                group f by f.Catgegory into fcat
                where fcat.Key != FilterCategoryId.author &&
                fcat.Key != FilterCategoryId.subject &&
                fcat.Key != FilterCategoryId.xtargets
                select fcat;

            List <string> cat = new List <string>();

            foreach (IGrouping <FilterCategoryId, Filter> fcat in queryFiltersByCategory)
            {
                cat.Add(String.Format("{0}={1}", fcat.Key, String.Join("|", (from f in fcat select f.Id).ToList <string>())));
            }

            return(String.Join(",", cat));
        }