RelationalCommand.ExecuteScalarAsync 方法

定义

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

public virtual System.Threading.Tasks.Task<object> ExecuteScalarAsync (Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject parameterObject, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<object?> ExecuteScalarAsync (Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject parameterObject, System.Threading.CancellationToken cancellationToken = default);
abstract member ExecuteScalarAsync : Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
override this.ExecuteScalarAsync : Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public Overridable Function ExecuteScalarAsync (parameterObject As RelationalCommandParameterObject, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

参数

parameterObject
RelationalCommandParameterObject

此方法的参数。

cancellationToken
CancellationToken

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

返回

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

实现

例外

适用于