If I try to add a block, which contains a lambda filter on the boolean field, which can be used with nhibernate linq query Is, the filter is being ignored:
var results = session.ink (). Where (x => x accepted);
The session is an iSession and the newspaper is a simple object field newspaper Id, name - varchar (50) and approved - bit.
When I run it, the following SQL is generated:
SELECT this_.NewspaperId as Newspape1_33_0_, this_Name as name 33_0_, this_. Accepted as approved 33_0_, from newspapers it _ _
It seems that it ignores the lambda if it is for boolean field, this name works well for the field, that is:
var results = session.ink (). Where (x => x.Name == "The Times");
In the result: exec sp_executesql N'SELECT this_.NewspaperId as Newspap 1_33_0_, name it as the name 33_0_, this_. Approved as accepted, 33_0_ from newspapers, this_ WHERE this_Name = @ p0 ', N' @00 nvarchar (9) ', @ p0 = N' The Times'
Nobody knows that I am bullian Why not ask on the value?
Any help is greatly appreciated I am using NH12Nate 2.1 with linber
It's been a while, so you probably probably got your answer some time ago. But to answer your question: I can not see a reason because it will not work. Actually, I have tried it in both NH2.1.2 and NH3.0.0. It works in both (verified by looking at the query with SQL Profiler), so it would be interesting to see the mapping how you used it, there is something wrong.
Comments
Post a Comment