Created
March 14, 2016 23:52
-
-
Save RyanABailey/1c0cf91cad088e1e5c96 to your computer and use it in GitHub Desktop.
Search facet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Expression<Func<SearchModel, bool>> GetCategoryFacetPredicate(List<string> categories) | |
{ | |
var predicate = PredicateBuilder.True<SearchModel>(); // Items which meet the predicate | |
foreach (var category in categories) | |
{ | |
predicate = predicate.Or(x => x.Category == category); | |
} | |
return predicate; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment