I\'m using EF 6.0 with LINQ in MVC 5 project. I want to log all the SQL queries executed by the Entity Framework DbContext for debugging/performance-measurement purpose.
You can use this line to log the SQL queries to the Visual Studio "Output" window only and not to a console window, again in Debug mode only.
public class YourContext : DbContext { public YourContext() { Database.Log = sql => Debug.Write(sql); } }