Is there any way to in .NET to see what LINQ query against database we are firing? For eg. I am wring a query in LINQ and I want to see that what SQL query is firing to communic
If you have a DbContext on which you firing your LINQ queries you can simply set the DbContext.Database.Log
property to something like this:
yourContext.Database.Log = (msg => System.Diagnostics.Debug.Write(msg, "SQL"));
After this, every SQL query shows up in the Debug console from your Visual Studio with the category SQL.