Log generated SQL from Entity Framework. context.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);