RelationalCommandExtensions.ExecuteScalarAsync 方法

定义

使用单个标量结果异步执行命令。

public static System.Threading.Tasks.Task<object> ExecuteScalarAsync (this Microsoft.EntityFrameworkCore.Storage.IRelationalCommand command, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Threading.CancellationToken cancellationToken = default);
static member ExecuteScalarAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalCommand * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function ExecuteScalarAsync (command As IRelationalCommand, connection As IRelationalConnection, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

参数

command
IRelationalCommand

要执行的命令。

connection
IRelationalConnection

要对其执行的连接。

cancellationToken
CancellationToken

等待 CancellationToken 任务完成时要观察的 。

返回

表示异步操作的任务。 任务结果包含命令的结果。

适用于