A quick tip if you want to log what’s going on inside Entity Framework:
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 class SampleContext : DbContext | |
{ | |
public SampleContext() | |
{ | |
#if DEBUG | |
this.Database.Log = logMessage=> Debug.Print(logMessage); | |
#endif | |
} | |
} | |
This will log not only the query, but also other useful information like the execution time, etc…