Reputation: 33
I am trying to generate sql query using .ToTraceString() in entity framework 3,5; but I am getting the following error
Cannot convert type 'System.Collections.Generic.List to 'System.Data.Objects.ObjectQuery'
I have the following code I need to generate sql query
customers= ent.Customer .Include("UserType") .Include("User") .Where(c => c.Enabled == true) .ToList<Customer>();
How to get sql query generated by entity framework. I don't have sql profiler.
Many thanks
Upvotes: 1
Views: 217
Reputation: 6293
Try not to call ToList() prior calling ToTraceString() because when you do you have list returned which doesn't have ToTraceString() method
Upvotes: 1