IDbConnectionInterceptor.ConnectionCreated Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called just after EF creates a DbConnection. This event is not triggered if the application provides the connection to use.
public virtual System.Data.Common.DbConnection ConnectionCreated (Microsoft.EntityFrameworkCore.Diagnostics.ConnectionCreatedEventData eventData, System.Data.Common.DbConnection result);
abstract member ConnectionCreated : Microsoft.EntityFrameworkCore.Diagnostics.ConnectionCreatedEventData * System.Data.Common.DbConnection -> System.Data.Common.DbConnection
override this.ConnectionCreated : Microsoft.EntityFrameworkCore.Diagnostics.ConnectionCreatedEventData * System.Data.Common.DbConnection -> System.Data.Common.DbConnection
Public Overridable Function ConnectionCreated (eventData As ConnectionCreatedEventData, result As DbConnection) As DbConnection
Parameters
- eventData
- ConnectionCreatedEventData
Contextual information about the connection.
- result
- DbConnection
The connection that has been created. This value is typically used as the return value for the implementation of this method.
Returns
The result that EF will use.
An implementation of this method for any interceptor that is not attempting to change the result
is to return the result
value passed in.
Applies to
Entity Framework