Last active
May 17, 2020 23:49
-
-
Save zHaytam/4eac0564b10aeef35a663bed7a4f06c5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var predicate = new DynamicFilterBuilder<Product>() | |
.And("Enabled", FilterOperator.Equals, true) | |
.And(b => b.And("Brand", FilterOperator.Equals, "Nike").Or("Brand", FilterOperator.Equals, "Adidas")) | |
.And(b => b.And("Price", FilterOperator.GreaterThanOrEqual, 20).And("Price", FilterOperator.LessThanOrEqual, 100)) | |
.Build(); | |
var products = _dbContext.Products.AsQueryable().Where(predicate).ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment