How do I view the SQL generated by entity framework ?
(In my particular case I\'m using the mysql provider - if it matters)
In my case for EF 6+, instead of using this in the Immediate Window to find the query string:
var sql = ((System.Data.Entity.Core.Objects.ObjectQuery)query).ToTraceString();
I ended up having to use this to get the generated SQL command:
var sql = ((System.Data.Entity.Infrastructure.DbQuery<<>f__AnonymousType3>)query).ToString();
Of course your anonymous type signature might be different.
HTH.