Partilhar via


IDbConnectionInterceptor.ConnectionClosing Método

Definição

Chamado pouco antes do EF pretende chamar Close().

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult ConnectionClosing (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult ConnectionClosing (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
abstract member ConnectionClosing : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
abstract member ConnectionClosing : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
override this.ConnectionClosing : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
Public Function ConnectionClosing (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As InterceptionResult
Public Overridable Function ConnectionClosing (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 suprimiu 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