I need to do a log of all SQL statements done. I'm using EF5 and this is my context constructor
public partial class Entities : ObjectContext
{
public const string ConnectionString = "name=Entities";
public const string ContainerName = "Entities";
#region Constructors
public Entities()
: base(ConnectionString, ContainerName)
{
this.ContextOptions.LazyLoadingEnabled = true;
}
Update:
This works fine for me: http://efwrappers.codeplex.com/
something like this:
context.Database.Log = Console.Write;
for more info:
http://msdn.microsoft.com/en-us/data/dn469464.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With