How do I view the SQL generated by entity framework ?
(In my particular case I\'m using the mysql provider - if it matters)
To have the query always handy, without changing code add this to your DbContext and check it on the output window in visual studio.
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
Database.Log = (query)=> Debug.Write(query);
}
Similar to @Matt Nibecker answer, but with this you do not have to add it in your current code, every time you need the query.