Bagikan melalui


IDbConnectionInterceptor.ConnectionDisposing Metode

Definisi

Dipanggil tepat sebelum EF berniat untuk DbConnectionmemanggil Dispose() .

public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult ConnectionDisposing (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
abstract member ConnectionDisposing : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
override this.ConnectionDisposing : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult
Public Overridable Function ConnectionDisposing (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As InterceptionResult

Parameter

connection
DbConnection

Koneksi.

eventData
ConnectionEventData

Informasi kontekstual tentang koneksi.

result
InterceptionResult

Mewakili hasil saat ini jika ada. Nilai ini akan diatur IsSuppressed ke true jika beberapa pencegat sebelumnya menekan eksekusi dengan memanggil Suppress(). Nilai ini biasanya digunakan sebagai nilai pengembalian untuk implementasi metode ini.

Mengembalikan

Jika IsSuppressed adalah false, EF akan berlanjut seperti biasa. Jika IsSuppressed adalah true, maka EF akan menekan operasi yang akan dilakukannya. Implementasi metode ini untuk setiap pencegat yang tidak mencoba menekan operasi adalah mengembalikan nilai yang result diteruskan.

Berlaku untuk