IDbConnectionInterceptor.ConnectionOpeningAsync(DbConnection, ConnectionEventData, InterceptionResult, CancellationToken) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
EF 'in çağrılması için yeterlidir OpenAsync() .
public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ConnectionOpeningAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ConnectionOpeningAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result, System.Threading.CancellationToken cancellationToken = default);
abstract member ConnectionOpeningAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
abstract member ConnectionOpeningAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
Public Function ConnectionOpeningAsync (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult, Optional cancellationToken As CancellationToken = Nothing) As Task(Of InterceptionResult)
Public Function ConnectionOpeningAsync (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult, Optional cancellationToken As CancellationToken = Nothing) 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.
- cancellationToken
- CancellationToken
CancellationTokenGörevin tamamlanması beklenirken gözlemlenemedi.
Döndürülenler
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.
Özel durumlar
İptal edilirse CancellationToken .