henkmollema/Dommel

Parentheses in SQL WHERE clause not working

Closed this issue · 1 comments

I found an issue when using Select function. Here is a simple example:

var products = connection.Select<Product>(p => p.Id > 0 && (p.Id == 1 || p.Id < 0))

The SQL WHERE clause created by Dommel does not have parentheses for the "or" condition. This makes the incorrect logic. In the above example, Product with Id 1 can't be fetched when using Dommel v3.0.0.

This is rather a missing feature than a bug, also a duplicate of #247.
I'll be looking into your attempt to fix it in FisherTsai@3c053d1 as well.