DbContextErrorEventData 构造函数

定义

构造事件有效负载。

public DbContextErrorEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, Microsoft.EntityFrameworkCore.DbContext context, Exception exception);
new Microsoft.EntityFrameworkCore.Diagnostics.DbContextErrorEventData : Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase * Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase, Microsoft.EntityFrameworkCore.Diagnostics.EventData, string> * Microsoft.EntityFrameworkCore.DbContext * Exception -> Microsoft.EntityFrameworkCore.Diagnostics.DbContextErrorEventData
Public Sub New (eventDefinition As EventDefinitionBase, messageGenerator As Func(Of EventDefinitionBase, EventData, String), context As DbContext, exception As Exception)

参数

eventDefinition
EventDefinitionBase

事件定义。

messageGenerator
Func<EventDefinitionBase,EventData,String>

生成此事件的日志消息的委托。

context
DbContext

当前的 DbContext

exception
Exception

触发此事件的异常。

适用于