EF Profiler - How Does It Work?

I am trying to learn more about trying to connect to the ADO.Net/EF pipeline and how to unintuitively connect to the pipeline (to dump queries, results, etc. into my log).

All that I saw suggests that there is no way to unobtrusively or without using SQL Profiler ... But I know that it is possible as the best EF Profiler manages to do this.

+3
source share
1 answer

I don’t know exactly how EfProf works internally, but EF expands as custom providers - with the help of a custom provider you can wrap an existing provider (i.e. SQL Server) and check all traffic - this allows you to profile. This article focuses on this topic: Tracing and caching vendor wrappers for the Entity platform - it provides sample code.

Whenever you issue a LINQ or Entity SQL query through an ObjectContext, the instance of the query goes through a series of layers (see the figure below). At a high level, we can say that all requests and updates from ObjectContext are translated and executed through EntityConnection, which, in turn, is a data provider for a specific server, such as SqlClient Client or Sql Server CE.

, Entity , Entity Framework .

- , :

, , ,

enter image description here

+2

All Articles