ExecuteQuery() method returns an IEnumerable but is there a way to make it return IQueryable?
Well, you can call AsQueryable
, but it won't do any good. The problem is that when you use ExecuteQuery
, the query isn't composable because LINQ to SQL doesn't "understand" it as such.
One of the core purposes of IQueryable<T>
is to allow the various aspects of a query to be composed together and then LINQ to SQL can convert them into a single SQL query. That just doesn't work when one of the bits of the query is effectively opaque.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With