CoreLoggerExtensions.OptimisticConcurrencyExceptionAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
OptimisticConcurrencyExceptionAsync(IDiagnosticsLogger<DbLoggerCategory.Update>, DbContext, Exception, CancellationToken)
public static System.Threading.Tasks.Task OptimisticConcurrencyExceptionAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Update> diagnostics, Microsoft.EntityFrameworkCore.DbContext context, Exception exception, System.Threading.CancellationToken cancellationToken = default);
static member OptimisticConcurrencyExceptionAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Update> * Microsoft.EntityFrameworkCore.DbContext * Exception * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function OptimisticConcurrencyExceptionAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Update), context As DbContext, exception As Exception, Optional cancellationToken As CancellationToken = Nothing) As Task
参数
- diagnostics
- IDiagnosticsLogger<DbLoggerCategory.Update>
要使用的诊断记录器。
- context
- DbContext
正在使用的上下文。
- exception
- Exception
导致此事件的异常。
- cancellationToken
- CancellationToken
等待 CancellationToken 任务完成时要观察的 。
返回
Task异步结果的 。
例外
适用于
OptimisticConcurrencyExceptionAsync(IDiagnosticsLogger<DbLoggerCategory.Update>, DbContext, IReadOnlyList<IUpdateEntry>, DbUpdateConcurrencyException, Func<DbContext,DbUpdateConcurrencyException,IReadOnlyList<IUpdateEntry>, EventDefinition<Exception>,ConcurrencyExceptionEventData>, CancellationToken)
public static System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> OptimisticConcurrencyExceptionAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Update> diagnostics, Microsoft.EntityFrameworkCore.DbContext context, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> entries, Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException exception, Func<Microsoft.EntityFrameworkCore.DbContext,Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException,System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry>,Microsoft.EntityFrameworkCore.Diagnostics.EventDefinition<Exception>,Microsoft.EntityFrameworkCore.Diagnostics.ConcurrencyExceptionEventData>? createEventData, System.Threading.CancellationToken cancellationToken = default);
static member OptimisticConcurrencyExceptionAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Update> * Microsoft.EntityFrameworkCore.DbContext * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> * Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException * Func<Microsoft.EntityFrameworkCore.DbContext, Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry>, Microsoft.EntityFrameworkCore.Diagnostics.EventDefinition<Exception>, Microsoft.EntityFrameworkCore.Diagnostics.ConcurrencyExceptionEventData> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
<Extension()>
Public Function OptimisticConcurrencyExceptionAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Update), context As DbContext, entries As IReadOnlyList(Of IUpdateEntry), exception As DbUpdateConcurrencyException, createEventData As Func(Of DbContext, DbUpdateConcurrencyException, IReadOnlyList(Of IUpdateEntry), EventDefinition(Of Exception), ConcurrencyExceptionEventData), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult)
参数
- diagnostics
- IDiagnosticsLogger<DbLoggerCategory.Update>
要使用的诊断记录器。
- context
- DbContext
正在使用的上下文。
- entries
- IReadOnlyList<IUpdateEntry>
并发冲突中涉及的条目。
- exception
- DbUpdateConcurrencyException
导致此事件的异常。
- createEventData
- Func<DbContext,DbUpdateConcurrencyException,IReadOnlyList<IUpdateEntry>,EventDefinition<Exception>,ConcurrencyExceptionEventData>
可选委托,用于替代事件数据创建。
- cancellationToken
- CancellationToken
等待 CancellationToken 任务完成时要观察的 。
返回
Task异步结果的 。