henkmollema/Dommel

Select() does not apply brackets with AND (&&) OR(||) properly

fanda-india opened this issue · 4 comments

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();**

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!

Had the same error. Couldn't solve it and change it to normal dapper sql.

I'll take a look into this one.

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.