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: A simple event that exposes the DbCommand object being executed would be the most flexible - and easy to for guys to design/implement. The consumer can then log the CommandText and format the command parameters as desired.
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: A simple event that exposes the DbCommand object being executed would be the most flexible - and easy to for guys to design/implement. The consumer can then log the CommandText and format the command parameters as desired.