Visual Studio Entity Framework (EF) generates SQL code performance queries

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.