If you want to track what entity framework (6.0 or more) is doing, you can convert your actions in sql code.

What you have to do is:

using (var db = new AccessData.Entities())
{
//logger: is a function to write output in a file txt
db.Database.Log = s => Utility.Logger(s);
//example
var list = db.myTable.Where( x => x.NOME = "piero");
//you will find in your txt file the sql code of the
//operation above (SELECT * FROM myTable where NOME="piero");
}

Note: 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. More infos here.

Advertisements