Is it possible to access the DataContext object behind an IQueryable?
If so, how?
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.
DataContext is specific to LINQ to SQL, so presumably you’re talking about LINQ to SQL queries? If so, there’s no safe way to do this – you have to resort to a hack such as using reflection to retrieve the private “context” field of the underlying DataQuery object: