Skip to content

Instantly share code, notes, and snippets.

@matijagrcic
Created April 1, 2014 12:03
Show Gist options
  • Save matijagrcic/9912587 to your computer and use it in GitHub Desktop.
Save matijagrcic/9912587 to your computer and use it in GitHub Desktop.
Entity Framework Diagnostics Clutch
public static string TracePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
"Dummy.txt");
public static void WriteTrace(string trace)
{
using (StreamWriter file = new StreamWriter(TracePath, true))
{
file.WriteLine(trace);
}
}
Clutch.Diagnostics.EntityFramework.DbTracing.Enable(new GenericDbTracingListener()
.OnFinished(p => WriteTrace(p.Command.ToTraceString())));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment