We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to use the PredicateBuilder to do an 'Or' in my where clause like so:
PredicateBuilder
var predicate = PredicateBuilder.New<MyItem>(); foreach (var item in items) { predicate = predicate.Or(x => x.Prop1 == item.Prop1 && x.Prop2 == item.Prop2); } var result = await this.ApplicationDbContext .Items .Where(predicate.DefaultExpression) .ToListAsync(cancellationToken);
This executes the SQL:
SELECT [f].[Prop1], [f].[Prop2] FROM [foo].[MyItem] AS [f] WHERE 0 = 1
Here is what MyItem looks like, it has nullable properties:
MyItem
public class MyItem { int? Prop1 { get; set; } int? Prop2 { get; set; } }
The expression does not seem to be built properly and no 'Or' clauses get added. Are nullable types supported?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to use the
PredicateBuilder
to do an 'Or' in my where clause like so:This executes the SQL:
Here is what
MyItem
looks like, it has nullable properties:The expression does not seem to be built properly and no 'Or' clauses get added. Are nullable types supported?
The text was updated successfully, but these errors were encountered: