IRelationalCommandDiagnosticsLogger.CommandNonQueryExecutedAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
CommandNonQueryExecutedAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, Int32, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)
事件的 CommandExecuted 日志。
public System.Threading.Tasks.ValueTask<int> CommandNonQueryExecutedAsync(Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Guid commandId, Guid connectionId, int methodResult, DateTimeOffset startTime, TimeSpan duration, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource, System.Threading.CancellationToken cancellationToken = default);
abstract member CommandNonQueryExecutedAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * int * DateTimeOffset * TimeSpan * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
Public Function CommandNonQueryExecutedAsync (connection As IRelationalConnection, command As DbCommand, context As DbContext, commandId As Guid, connectionId As Guid, methodResult As Integer, startTime As DateTimeOffset, duration As TimeSpan, commandSource As CommandSource, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Integer)
参数
- connection
- IRelationalConnection
连接。
- command
- DbCommand
数据库命令对象。
- connectionId
- Guid
与 DbConnection 所使用的关联 ID 相关联。
- methodResult
- Int32
基础方法执行的返回值。
- startTime
- DateTimeOffset
执行开始的时间。
- duration
- TimeSpan
命令执行的持续时间,不包括使用结果。
- commandSource
- CommandSource
命令的源。
- cancellationToken
- CancellationToken
等待任务完成时观察的 A CancellationToken 。
返回
执行的结果,可能已被侦听器修改。
例外
如果取消了该操作 CancellationToken 。
适用于
CommandNonQueryExecutedAsync(IRelationalConnection, DbCommand, String, DbContext, Guid, Guid, Int32, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)
事件的 CommandExecuted 日志。
public System.Threading.Tasks.ValueTask<int> CommandNonQueryExecutedAsync(Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, string logCommandText, Microsoft.EntityFrameworkCore.DbContext? context, Guid commandId, Guid connectionId, int methodResult, DateTimeOffset startTime, TimeSpan duration, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource, System.Threading.CancellationToken cancellationToken = default);
abstract member CommandNonQueryExecutedAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * string * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * int * DateTimeOffset * TimeSpan * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
Public Function CommandNonQueryExecutedAsync (connection As IRelationalConnection, command As DbCommand, logCommandText As String, context As DbContext, commandId As Guid, connectionId As Guid, methodResult As Integer, startTime As DateTimeOffset, duration As TimeSpan, commandSource As CommandSource, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Integer)
参数
- connection
- IRelationalConnection
连接。
- command
- DbCommand
数据库命令对象。
- logCommandText
- String
可以记录的命令文本。
- connectionId
- Guid
与 DbConnection 所使用的关联 ID 相关联。
- methodResult
- Int32
基础方法执行的返回值。
- startTime
- DateTimeOffset
执行开始的时间。
- duration
- TimeSpan
命令执行的持续时间,不包括使用结果。
- commandSource
- CommandSource
命令的源。
- cancellationToken
- CancellationToken
等待任务完成时观察的 A CancellationToken 。
返回
执行的结果,可能已被侦听器修改。
例外
如果取消了该操作 CancellationToken 。