-
Hi, I'm getting an error: predicate can't parse. This is my code: public IEnumerable GetMessages(int recipientId, bool? isRead) { var results = SetLimit(1, 10) .FindAll(x => x.Recipient_Id == recipientId && (isRead == null || x.IsRead == isRead)); return results; } Is there any way to apply next conditions if for example value is not null as above? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@minik42 Hi, problem with this part public IEnumerable GetMessages(int recipientId, bool isRead)
{
var results = SetLimit(1, 10)
.FindAll(x => x.Recipient_Id == recipientId && x.IsRead == isRead);
return results;
} Check this out SqlGenerator.AppendWherePredicateQuery.cs#L82 |
Beta Was this translation helpful? Give feedback.
-
Sure, but I want my parameters to be optional, that's why it is |
Beta Was this translation helpful? Give feedback.
@minik42 It's difficult to parse. This library supports only simple expressions by design. Use Raw SQL or try this