Improper handling of lambdas that look like 'x => true' in queries

Description

In the following code the second query (x => true) should behave identically
to the third one, but it doesn't.

var sequence = session.Query<T>();

var wtfSequence = sequence.Where(x => true);
var okaySequence = sequence.Where(x => x.Id > 0);

Here are some sample SQL queries for both queries (note the 'True' and 'true' mismatch):

NHibernate: select cast(count as INTEGER) as col_0_0_ from "BinaryUnitProxy_IndicatorUnitDescriptor" binaryunit0_ where @p0='true';@p0 = 'True' [Type: String (0)]

NHibernate: select cast(count as INTEGER) as col_0_0_ from "BinaryUnitProxy_IndicatorUnitDescriptor" binaryunit0_ where binaryunit0_.Id>@p0;@p0 = 0 [Type: Int32 (0)]

Additional information can be found here:
http://stackoverflow.com/questions/4934658/c-strange-lambda-behavior

Environment

None

Assignee

Unassigned

Reporter

Jan3A1r Jan3A1r

Labels

None

Components

Affects versions

Priority

Blocker
Configure