共用方式為


IRelationalCommandDiagnosticsLogger.CommandCreating 方法

定義

CommandCreating事件的記錄。

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> CommandCreating (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod commandMethod, Microsoft.EntityFrameworkCore.DbContext? context, Guid commandId, Guid connectionId, DateTimeOffset startTime, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource);
abstract member CommandCreating : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * DateTimeOffset * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
Public Function CommandCreating (connection As IRelationalConnection, commandMethod As DbCommandMethod, context As DbContext, commandId As Guid, connectionId As Guid, startTime As DateTimeOffset, commandSource As CommandSource) As InterceptionResult(Of DbCommand)

參數

connection
IRelationalConnection

連接。

commandMethod
DbCommandMethod

將在此命令上呼叫的方法類型。

context
DbContext

DbContext目前使用的 ,如果不知道,則為 null。

commandId
Guid

與指定 DbCommand 相關聯的相互關聯識別碼。

connectionId
Guid

與使用中相關聯的 DbConnection 相互關聯識別碼。

startTime
DateTimeOffset

開始執行的時間。

commandSource
CommandSource

命令的來源。

傳回

攔截的結果。

適用於