How can I debug EF? (parse SQL queries)

How can I debug Entity Framework? Can I see what queries he is trying to execute on the SQL server for troubleshooting?

+6
source share
4 answers

Check out the MVC Mini Profiler: http://code.google.com/p/mvc-mini-profiler/

It is very lightweight, does not invade your application and is easily removed if required. In addition, qaru uses it.

+8
source

You can send a query to ObjectQuery and then use ObjectQuery.ToTraceString() -, which returns the full SQL for your query. Alternatively, of course, you can simply use SQL Profiler in your database to find out which SQL is executed.

+2
source

You can use Profiler Framework Profiler. http://efprof.com/ .

+1
source

You can use the Monitoring tool on the server to directly view the queues.
For MSSQL Server see: http://blog.pengoworks.com/index.cfm/2008/1/3/View-recently-run-queries-in-MSSQL-2005

0
source

Source: https://habr.com/ru/post/898487/


All Articles