How do I view the SQL generated by the Entity Framework?

For those using Entity Framework 6 and up, if you want to view the output SQL in Visual Studio (like I did) you have to use the new logging/interception functionality. Adding the following line will spit out the generated SQL (along with additional execution-related details) in the Visual Studio output panel: using (MyDatabaseEntities context = … Read more