Last active
May 17, 2020 23:37
-
-
Save zHaytam/ff714ab68515b91b23a6466c5c3ddb22 to your computer and use it in GitHub Desktop.
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
var predicate = DynamicExpressions.GetPredicate<Product>(propertySentByUser, operatorSentByUser, valueSentByUser); | |
// ^ can also be cached or compiled and used anywhere | |
var products = _dbContext.Products.AsQueryable().Where(predicate).ToList(); | |
// ^ or FirstByDefault, Any, etc... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment