Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View sql queries generated by EF Core

Is there anyway to see what SQL query EF Core is generating? (ASP .Net Core 1.1)

like image 420
Fabricio Rodriguez Avatar asked Jul 12 '17 11:07

Fabricio Rodriguez


1 Answers

Just my opinion, but I believe the easiest, fastest and cleanest solution is to use SQL Profiler.

Just run the SQL Profiler that comes with SSMS, start the trace, execute the action that executes the query, pause the trace and check the exact query that was executed.

It's independent of the EF version you are using.

like image 74
João Pereira Avatar answered Oct 13 '22 11:10

João Pereira