views:

124

answers:

1

It seems that LINQ-to-NHibernate and LINQ-to-SQL does not support short-circuit evaluation in where clause of query.

Am I right? Is there any workaround? May it be added to next versions of LINQ-to-NHibernate and LINQ-to-SQL?

for more information plz see followings:

http://stackoverflow.com/questions/772261/the-or-operator-in-linq-with-c

http://stackoverflow.com/questions/2306302/why-ordinary-laws-in-evaluting-boolean-expression-does-not-fit-into-linq

A: 

Huh? In LinqToSql, your c# query in code is converted to an expression tree and then a sql statement. The sql statement is handed to mssqlserver which certainly does do short circuiting.

Also note: mssqlserver does not throw null reference exceptions.

David B
according to http://stackoverflow.com/questions/2306302/why-ordinary-laws-in-evaluting-boolean-expression-does-not-fit-into-linq there is some problems with it...
afsharm
Microsoft can't add anything to linq to sql or to sql server to resolve your problem, because it's not occuring in those layers.
David B