IDbConnectionInterceptor.ConnectionClosingAsync Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Appelé juste avant qu’EF ait l’intention d’appeler CloseAsync() dans un contexte asynchrone.
public virtual System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ConnectionClosingAsync(System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ConnectionClosingAsync(System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
public System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ConnectionClosingAsync(System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
abstract member ConnectionClosingAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
override this.ConnectionClosingAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
abstract member ConnectionClosingAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
abstract member ConnectionClosingAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
Public Overridable Function ConnectionClosingAsync (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As ValueTask(Of InterceptionResult)
Public Function ConnectionClosingAsync (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As Task(Of InterceptionResult)
Public Function ConnectionClosingAsync (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As ValueTask(Of InterceptionResult)
Paramètres
- connection
- DbConnection
Connexion.
- eventData
- ConnectionEventData
Informations contextuelles sur la connexion.
- result
- InterceptionResult
Représente le résultat actuel s’il en existe un.
Cette valeur a IsSuppressed la valeur si true un intercepteur précédent a supprimé l’exécution en appelant Suppress().
Cette valeur est généralement utilisée comme valeur de retour pour l’implémentation de cette méthode.
Retours
Si IsSuppressed c’est falsele cas, EF continuera normalement.
Si IsSuppressed c’est truele cas, EF supprime l’opération qu’il était sur le point d’effectuer.
Une implémentation de cette méthode pour tout intercepteur qui ne tente pas de supprimer l’opération consiste à retourner la result valeur passée.