Select() does not apply brackets with AND (&&) OR(||) properly
fanda-india opened this issue · 4 comments
fanda-india commented
Connection.Select() returns wrong results due to that it does not apply brackets properly.
Please find the below example:
Expression<Func<UnitModel, bool>> filters =
(u) => (u.OrgId == orgId) &&
( u.Code.Contains(searchTerm) || u.Name.Contains(searchTerm) );
**con.Select(filters).ToList();**
fanda-india commented
Feel this library is very useful and it saves lots of time who uses Dapper. Excellently designed and developed and this helps a lot to use Dapper. Appreciate @henkmollema!
BelvedereHenrique commented
Had the same error. Couldn't solve it and change it to normal dapper sql.
lucaxchaves commented
I'll take a look into this one.
henkmollema commented
This would be neat, but turns out to be pretty hard to get right. I'll leave it on the backlog for someone (or myself) to pick it up someday.