Partager via


IDbCommandInterceptor.DataReaderClosingAsync Méthode

Définition

Appelé juste avant qu’EF a l’intention d’appeler CloseAsync() dans un contexte asynchrone.

public virtual System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> DataReaderClosingAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.DataReaderClosingEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
abstract member DataReaderClosingAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.DataReaderClosingEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
override this.DataReaderClosingAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.DataReaderClosingEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
Public Overridable Function DataReaderClosingAsync (command As DbCommand, eventData As DataReaderClosingEventData, result As InterceptionResult) As ValueTask(Of InterceptionResult)

Paramètres

command
DbCommand

Commande.

eventData
DataReaderClosingEventData

Informations contextuelles sur la commande.

result
InterceptionResult

Représente le résultat actuel s’il en existe un. Cette valeur aura IsSuppressed la true valeur si certains intercepteurs précédents ont 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 a la valeur false, EF continue comme d’habitude. Si IsSuppressed a la valeur true, 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.

S’applique à