RelationalLoggerExtensions.CommandCreating 方法

定义

CommandCreating事件的日志。

public static Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> CommandCreating (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod commandMethod, Microsoft.EntityFrameworkCore.DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime);
static member CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * DateTimeOffset -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
<Extension()>
Public Function CommandCreating (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), connection As IRelationalConnection, commandMethod As DbCommandMethod, context As DbContext, commandId As Guid, connectionId As Guid, startTime As DateTimeOffset) As InterceptionResult(Of DbCommand)

参数

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

要使用的诊断记录器。

connection
IRelationalConnection

连接。

commandMethod
DbCommandMethod

将在此命令上调用的方法的类型。

context
DbContext

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

commandId
Guid

与给定 DbCommand关联的关联 ID。

connectionId
Guid

与正在使用的 DbConnection 关联的关联 ID。

startTime
DateTimeOffset

执行开始的时间。

返回

截获的结果。

适用于