AI OnAI Off
Hi,
in this case, I think the right approach would be to use the "In" method:
.Filter(x => x.Category.In(categoryIds))
However, the reason why your code is not working is because you are never assigning the categoryFilter with the actualy filtering. Correct code should be:
foreach (var categoryId in categoryIds) { categoryFilter = categoryFilter.Or(x => x.Category.Match(categoryId)); }
You are correct, embarrassing mistake... Thanks for the .In() tip as well!
I have this method
What I want it to do is to filter on a boolean called IsSticky where the root page is the root page parameter and where the page has the category parameters provided. Now this method works equally with or without the categoryFilter which makes me doubt I follow write correct code. Even if I change categoryFilter.Or to categoryFilter.And the result is the same, also categoryFilter.HasFilter always returns false.
What do I need to change to make this method take the category filtering into account? Thanks.