[3.0.5 MSSQL 2008] Bug by order of Where and Select in quey

[3.0.5 MSSQL 2008] Bug by order of Where and Select in quey

Postby Kam » Fri 21 Oct 2011 10:28

The this query is correct executed:
Code: Select all
var l = db.Users.Select(a => new { a.ID, a.Name }).Where(a => a.ID == id).ToList();


But on next query:
Code: Select all
var l = db.Users.Where(a => a.ID == id).Select(a => new { a.ID, a.Name }).ToList();


generate error:
Code: Select all
System.Exception: Operation could destabilize the runtime. ---> System.Security.VerificationException: Operation could destabilize the runtime. at lambda_method(Closure , c ) at Devart.Data.Linq.Provider.ObjectReader`1.g() at Devart.Data.Linq.Provider.ObjectReader`1.b() at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext() at Devart.Data.Linq.Provider.DataProvider.ReadQuery(CompiledQuery compiledQuery, IDbConnection con, f dataReader) at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult) at Devart.Data.Linq.Provider.DataProvider.ExecuteAllQueries(CompiledQuery compiledQuery, Object[] userArguments) at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Execute(Expression query) at Devart.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression) at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
...
Kam
 
Posts: 3
Joined: Fri 09 Sep 2011 10:09

Postby StanislavK » Mon 24 Oct 2011 16:06

Could you please specify the definition of the table you are querying? If possible, please send us a small sample with which the problem occurs. At the moment, we couldn't reproduce this issue in our environment.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to LinqConnect (LINQ to SQL support)