IDbConnectionInterceptor.ConnectionCreated Method

Definition

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