CommandErrorEventData 构造函数

定义

重载

CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbCommand, DbCommandMethod, Guid, Guid, Exception, Boolean, Boolean, DateTimeOffset, TimeSpan)

构造事件有效负载。

CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, Boolean, Boolean, DateTimeOffset, TimeSpan)
已过时.

构造事件有效负载。

CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, Boolean, Boolean, DateTimeOffset, TimeSpan, CommandSource)

构造事件有效负载。

CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbCommand, DbCommandMethod, Guid, Guid, Exception, Boolean, Boolean, DateTimeOffset, TimeSpan)

构造事件有效负载。

public CommandErrorEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, bool async, bool logParameterValues, DateTimeOffset startTime, TimeSpan duration);
new Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData : Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase * Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase, Microsoft.EntityFrameworkCore.Diagnostics.EventData, string> * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * bool * bool * DateTimeOffset * TimeSpan -> Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData
Public Sub New (eventDefinition As EventDefinitionBase, messageGenerator As Func(Of EventDefinitionBase, EventData, String), command As DbCommand, executeMethod As DbCommandMethod, commandId As Guid, connectionId As Guid, exception As Exception, async As Boolean, logParameterValues As Boolean, startTime As DateTimeOffset, duration As TimeSpan)

参数

eventDefinition
EventDefinitionBase

事件定义。

messageGenerator
Func<EventDefinitionBase,EventData,String>

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

command
DbCommand

DbCommand失败时正在执行的 。

executeMethod
DbCommandMethod

DbCommand用于执行命令的方法。

commandId
Guid

标识正在使用的实例的相关 DbCommand ID。

connectionId
Guid

标识正在使用的实例的相关 DbConnection ID。

exception
Exception

执行失败时引发的异常。

async
Boolean

指示命令是否以异步方式执行。

logParameterValues
Boolean

指示应用程序是否允许记录参数值。

startTime
DateTimeOffset

此事件的开始时间。

duration
TimeSpan

此事件的持续时间。

适用于

CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, Boolean, Boolean, DateTimeOffset, TimeSpan)

注意

Use the overload with CommandSource

构造事件有效负载。

public CommandErrorEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, bool async, bool logParameterValues, DateTimeOffset startTime, TimeSpan duration);
[System.Obsolete("Use the overload with CommandSource")]
public CommandErrorEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, bool async, bool logParameterValues, DateTimeOffset startTime, TimeSpan duration);
new Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData : Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase * Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase, Microsoft.EntityFrameworkCore.Diagnostics.EventData, string> * System.Data.Common.DbConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * bool * bool * DateTimeOffset * TimeSpan -> Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData
[<System.Obsolete("Use the overload with CommandSource")>]
new Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData : Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase * Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase, Microsoft.EntityFrameworkCore.Diagnostics.EventData, string> * System.Data.Common.DbConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * bool * bool * DateTimeOffset * TimeSpan -> Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData
Public Sub New (eventDefinition As EventDefinitionBase, messageGenerator As Func(Of EventDefinitionBase, EventData, String), connection As DbConnection, command As DbCommand, context As DbContext, executeMethod As DbCommandMethod, commandId As Guid, connectionId As Guid, exception As Exception, async As Boolean, logParameterValues As Boolean, startTime As DateTimeOffset, duration As TimeSpan)

参数

eventDefinition
EventDefinitionBase

事件定义。

messageGenerator
Func<EventDefinitionBase,EventData,String>

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

connection
DbConnection

DbConnection正在使用的 。

command
DbCommand

DbCommand失败时正在执行的 。

context
DbContext

当前 DbContext 正在使用的 ,如果未知,则为 null。

executeMethod
DbCommandMethod

DbCommand用于执行命令的方法。

commandId
Guid

标识正在使用的实例的相关 DbCommand ID。

connectionId
Guid

标识正在使用的实例的相关 DbConnection ID。

exception
Exception

执行失败时引发的异常。

async
Boolean

指示命令是否以异步方式执行。

logParameterValues
Boolean

指示应用程序是否允许记录参数值。

startTime
DateTimeOffset

此事件的开始时间。

duration
TimeSpan

此事件的持续时间。

属性

适用于

CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, Boolean, Boolean, DateTimeOffset, TimeSpan, CommandSource)

构造事件有效负载。

public CommandErrorEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, bool async, bool logParameterValues, DateTimeOffset startTime, TimeSpan duration, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource);
new Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData : Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase * Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase, Microsoft.EntityFrameworkCore.Diagnostics.EventData, string> * System.Data.Common.DbConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * bool * bool * DateTimeOffset * TimeSpan * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource -> Microsoft.EntityFrameworkCore.Diagnostics.CommandErrorEventData
Public Sub New (eventDefinition As EventDefinitionBase, messageGenerator As Func(Of EventDefinitionBase, EventData, String), connection As DbConnection, command As DbCommand, context As DbContext, executeMethod As DbCommandMethod, commandId As Guid, connectionId As Guid, exception As Exception, async As Boolean, logParameterValues As Boolean, startTime As DateTimeOffset, duration As TimeSpan, commandSource As CommandSource)

参数

eventDefinition
EventDefinitionBase

事件定义。

messageGenerator
Func<EventDefinitionBase,EventData,String>

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

connection
DbConnection

DbConnection正在使用的 。

command
DbCommand

DbCommand失败时正在执行的 。

context
DbContext

当前 DbContext 正在使用的 ,如果未知,则为 null。

executeMethod
DbCommandMethod

DbCommand用于执行命令的方法。

commandId
Guid

标识正在使用的实例的相关 DbCommand ID。

connectionId
Guid

标识正在使用的实例的相关 DbConnection ID。

exception
Exception

执行失败时引发的异常。

async
Boolean

指示命令是否以异步方式执行。

logParameterValues
Boolean

指示应用程序是否允许记录参数值。

startTime
DateTimeOffset

此事件的开始时间。

duration
TimeSpan

此事件的持续时间。

commandSource
CommandSource

命令的源。

适用于