Compartilhar via


IDbConnectionInterceptor.ConnectionOpening Método

Definição

Chamado pouco antes do EF pretende chamar Open().

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult ConnectionOpening (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult ConnectionOpening (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
abstract member ConnectionOpening : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
abstract member ConnectionOpening : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
override this.ConnectionOpening : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
Public Function ConnectionOpening (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As InterceptionResult
Public Overridable Function ConnectionOpening (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As InterceptionResult

Parâmetros

connection
DbConnection

A conexão.

eventData
ConnectionEventData

Informações contextuais sobre a conexão.

result
InterceptionResult

Representa o resultado atual se houver um. Esse valor terá IsSuppressed definido como true se algum interceptador anterior suprimisse a execução chamando Suppress(). Esse valor normalmente é usado como o valor retornado para a implementação desse método.

Retornos

Se IsSuppressed for false, o EF continuará normalmente. Se IsSuppressed for true, o EF suprimirá a operação que estava prestes a executar. Uma implementação desse método para qualquer interceptador que não esteja tentando suprimir a operação é retornar o result valor passado.

Aplica-se a