In Entity Framework 6, is it possible to view the SQL that will be executed for an insert before calling SaveChanges?
using (var db =
There is no equivalent of the query.ToString() AFAIK. You can eventually use DbContext.Database.Log property:
db.Database.Log = s =>
{
// You can put a breakpoint here and examine s with the TextVisualizer
// Note that only some of the s values are SQL statements
Debug.Print(s);
};
db.SaveChanges();