Equivalent to DataContext.Log in Entity Framework?

In Link-2-SQL, I can use the DataContext.Log property to view the exact queries that are thrown to SQL Server.

Is there an equivalent to this in the Entity Framework?

+4
source share
2 answers

Since the Entity Framework supports multiple backends (unlike Linq-to-SQL, which is only SQL Server), you cannot really get the actual SQL query sent to the server server from EF.

To really understand what is going on, I would recommend running SQL Profiler on the SQL Server backend and see what queries will be sent to it.

See the article article about Simple-Talk and maybe this video series , becoming a SQL Profiler wizard if you are not familiar with the SQL Profiler tool.

Mark

+1
source

All Articles