IDbConnectionInterceptor.ConnectionClosingAsync(DbConnection, ConnectionEventData, InterceptionResult) Yöntem

Tanım

EF Close() , zaman uyumsuz bir bağlamda çağırmayı amaçladığı için çağırılır.

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.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 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)

Parametreler

connection
DbConnection

Bağlantı.

eventData
ConnectionEventData

Bağlantıyla ilgili bağlamsal bilgiler.

result
InterceptionResult

Bir varsa geçerli sonucu temsil eder. Bu değer, IsSuppressed true bazı önceki bir yakalayıcıyı çağırarak yürütülecektir olarak ayarlanır Suppress() . Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.

Döndürülenler

Task<InterceptionResult>
ValueTask<InterceptionResult>

IsSuppressedYanlış ise, EF normal olarak devam eder. IsSuppressedTrue Ise EF, gerçekleştirmek üzere olduğu işlemi bastırır. Bu yöntemin, işlemi bastırmaya çalışan her bir şifre için normal bir uygulama, result geçirilen değeri döndürmesidir.

Şunlara uygulanır