Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Feature: Add hooks for tracing generated SQL [958]

$
0
0
We have a general item to add better lifecycle hooks to DbContext--see http://entityframework.codeplex.com/workitem/872

However, this doesn't fit in the schedule for EF6, so this work item is about adding specific hooks for getting SQL generated by EF without having to create a wrapping provider. This is for both queries and CRUD operations.

The probable approach for this will be to add one or more low-level interception services that can be registered via DbConfiguration.
Comments: Second checkin: ba4b72171f3a WorldLogSnorkellingChampion (Iteration on interception design and simple Database.Log property.) This change updates the command interception feature in four main ways: - More information about the commands being logged is now contained in the interception context and in particular a new DbCommandInterceptionContext that extends the general context to provide command-specific information. Additional information can be added to interception contexts in the future without making an interface breaking change. - The "Executed" calls for async commands are now not made until after the async operation is actually completed. This allows the async and non-async methods to be collapsed since the Task-based result can now be unwrapped. - The "Executed" calls are now made even if the command failed with an exception or the async task was canceled. - A new TextWriter property context.Database.Log has been added based on the similar property from LINQ to SQL. We will discuss at the design meeting exactly what should be included in this log and how it should be formatted. Database.Log uses by default DbCommandLogger, but this can be changed by setting a new DbCommandLoggerFactory.

Viewing all articles
Browse latest Browse all 10318

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>