From: Kamil K. (JIRA) <nh...@gm...> - 2010-12-30 20:54:08
|
LINQ generates strange SQL using equality operator in Where clause ------------------------------------------------------------------ Key: NH-2479 URL: http://216.121.112.228/browse/NH-2479 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.0.0.GA Reporter: Kamil Kliczbor Priority: Minor There is quite strange behaviour of the LINQ provider. Here is a link to the nhusers newsgroup where I asked about this behaviour : http://groups.google.com/group/nhusers/browse_thread/thread/24977a87fd03fbaa. I'am using 3.0.0GA release with the .NET Framework 3.5 and MS-SQL Server 2005. When generating SQL using LINQ Where clause, I get strange output SQL using CASE ... WHEN ... THEN statement. When there is query defined like this.Session.Query<Product>().Where(x => x.Discontinued).ToList(); it produces select statement given below: select ... from Products product0_ where product0_.Discontinued = 1 but when I use: this.Session.Query<Product>().Where(x => x.Discontinued == true).ToList(); it gives me: select ... from Products product0_ where case when product0_.Discontinued = 1 then 'true' else 'false' end = case when 'True' /* @p0 */ = 'true' then 'true' else 'false' end -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |