CommandErrorEventData 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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>
一個代表會為此事件產生日誌訊息。
- executeMethod
- DbCommandMethod
執行 DbCommand 指令的方法。
- 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。
- executeMethod
- DbCommandMethod
執行 DbCommand 指令的方法。
- 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。
- executeMethod
- DbCommandMethod
執行 DbCommand 指令的方法。
- connectionId
- Guid
一個識別 DbConnection 所使用的實例的相關ID。
- exception
- Exception
執行失敗時拋出的例外。
- async
- Boolean
表示指令是否以非同步方式執行。
- logParameterValues
- Boolean
表示應用程式是否允許參數值的記錄。
- startTime
- DateTimeOffset
這個活動的開始時間。
- duration
- TimeSpan
這個活動的持續時間。
- commandSource
- CommandSource
命令來源。
適用於
CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, String, 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, string logCommandText, 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 * string * 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, logCommandText As String, 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。
- logCommandText
- String
可以記錄的指令文字。
- executeMethod
- DbCommandMethod
執行 DbCommand 指令的方法。
- connectionId
- Guid
一個識別 DbConnection 所使用的實例的相關ID。
- exception
- Exception
執行失敗時拋出的例外。
- async
- Boolean
表示指令是否以非同步方式執行。
- logParameterValues
- Boolean
表示應用程式是否允許參數值的記錄。
- startTime
- DateTimeOffset
這個活動的開始時間。
- duration
- TimeSpan
這個活動的持續時間。
- commandSource
- CommandSource
命令來源。