LINQ to NHibernate removes parenthesis in where clause:
session.Query<MyEntity>().Where(x => (x.MyProp1 < end && x.MyProp1 > start) ||
(x.MyProp2 < end && x.MyProp2 > start));
This results in the following query (note the missing parenthesis):
select <columns> from MY_ENTITY where MY_PROP1 < :p0 and MY_PROP1 > :p1 or
MY_PROP2 < :p2 and MY_PROP2 > :p3;
This is a huge problem, because it changes the query condition significantly.
Is this a known problem or am I doing something wrong?