Visual Studio Entity Framework (EF) generates SQL code performance queries
In SQL, there areSQL Server Profiler can be used to query performance and view SQL code for external calls. However, after EF connects to MySQL, some of the code cannot query the SQL code generated by EF, as in the following code:
Db. Basedept.remove (basedept), DB. Basedept break point, the query to the SELECT statement, remove, will become the result of execution, the specific generated delete SQL code cannot be viewed.
For these features, we have chosen the following tools to monitor the code generated by EF:EntityFramework Profiler (Baidu network disk)
Download and unzip as follows:
1: Add HibernatingRhinos.Profiler.Appender.dll to the DLL reference of the VS project
2: In the Application_Start method of the Global.asax file, Add the following code: HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize ();
3: Run EFProf.exe (the exe file in the compressed package downloaded above), then the SQL code connected to the database operation in your code, as well as some performance or access URLs are all present here.
From for notes (Wiz)
Visual Studio Entity Framework (EF) generates SQL code performance queries