ExecuteQuery() method returns an IEnumerable but is there a way to make it return IQueryable?
ExecuteQuery() method returns an IEnumerable but is there a way to make it return
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, you can call
AsQueryable, but it won’t do any good. The problem is that when you useExecuteQuery, 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.