Created
April 1, 2014 12:03
-
-
Save matijagrcic/9912587 to your computer and use it in GitHub Desktop.
Entity Framework Diagnostics Clutch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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