I trying to filter out content pages by multiple categories:
I have Umbraco.DropDownMultiple in frontend, using webAPI storing these values in List<string>
but how to filter out them regards what categories or multicategories selected, my code below:
List in the model: public List<string> Category { get; set; }
var pages = Services.ContentService.GetDescendants(3000);
pgs = pages.Where(x => x.GetValue("mycat").ToString() == Category.FirstOrDefault()); - filtering just by first one. but how to filter using all Category list? Thank you
v7 how to filter IContent by using WebAPI
Help please :)
I trying to filter out content pages by multiple categories:
I have Umbraco.DropDownMultiple in frontend, using webAPI storing these values in List<string>
but how to filter out them regards what categories or multicategories selected, my code below:
List in the model: public List<string> Category { get; set; }
var pages = Services.ContentService.GetDescendants(3000);
pgs = pages.Where(x => x.GetValue("mycat").ToString() == Category.FirstOrDefault()); - filtering just by first one. but how to filter using all Category list? Thank you
Not quite sure right now but shouldn't
just work?
No, I wanted to search by more categories at once, ended doing foreach.
Thanks
is working on a reply...