IDbCommandInterceptor.CommandCreating Yöntem
Ö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 çağrısı yapmadan hemen önce çağrılır CreateCommand().
public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> CommandCreating (Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> result);
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> CommandCreating (Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> result);
abstract member CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
abstract member CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
override this.CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
Public Function CommandCreating (eventData As CommandCorrelatedEventData, result As InterceptionResult(Of DbCommand)) As InterceptionResult(Of DbCommand)
Public Overridable Function CommandCreating (eventData As CommandCorrelatedEventData, result As InterceptionResult(Of DbCommand)) As InterceptionResult(Of DbCommand)
- eventData
- CommandCorrelatedEventData
Komut ve yürütme hakkında bağlamsal bilgiler.
- result
- InterceptionResult<DbCommand>
Varsa geçerli sonucu temsil eder.
Önceki bir kesme noktası çağrısı SuppressWithResult(TResult)yaparak yürütmeyi engellediyse bu değer HasResult olarak ayarlanırtrue
.
Bu değer genellikle bu yöntemin uygulanması için dönüş değeri olarak kullanılır.
False HasResult ise EF normal şekilde devam eder.
True HasResult ise, EF gerçekleştirmek üzere olduğu işlemi bastırır ve bunun yerine kullanır Result .
Sonucu değiştirmeye çalışmayan herhangi bir kesme noktası için bu yöntemin bir uygulaması geçirilen değeri döndürmektir result
.
Ürün | Sürümler |
---|---|
Entity Framework Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework geri bildirimi
Entity Framework, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: