IRelationalCommand.ExecuteScalarAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ExecuteScalarAsync(RelationalCommandParameterObject, CancellationToken) |
以非同步方式執行具有單一純量結果的命令。 |
ExecuteScalarAsync(IRelationalConnection, IReadOnlyDictionary<String,Object>, CancellationToken) |
以非同步方式執行具有單一純量結果的命令。 |
ExecuteScalarAsync(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean, CancellationToken) |
已淘汰.
以非同步方式執行具有單一純量結果的命令。 |
ExecuteScalarAsync(RelationalCommandParameterObject, CancellationToken)
以非同步方式執行具有單一純量結果的命令。
public System.Threading.Tasks.Task<object> ExecuteScalarAsync (Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject parameterObject, System.Threading.CancellationToken cancellationToken = default);
public 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>
Public Function ExecuteScalarAsync (parameterObject As RelationalCommandParameterObject, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
參數
- parameterObject
- RelationalCommandParameterObject
這個方法的參數。
- cancellationToken
- CancellationToken
等候 CancellationToken 工作完成時要觀察的 。
傳回
代表非同步作業的工作。 工作結果包含命令的結果。
例外狀況
適用於
ExecuteScalarAsync(IRelationalConnection, IReadOnlyDictionary<String,Object>, CancellationToken)
以非同步方式執行具有單一純量結果的命令。
public System.Threading.Tasks.Task<object> ExecuteScalarAsync (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Collections.Generic.IReadOnlyDictionary<string,object> parameterValues, System.Threading.CancellationToken cancellationToken = default);
abstract member ExecuteScalarAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Collections.Generic.IReadOnlyDictionary<string, obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public Function ExecuteScalarAsync (connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
參數
- connection
- IRelationalConnection
要對其執行的連線。
- parameterValues
- IReadOnlyDictionary<String,Object>
參數的值。
- cancellationToken
- CancellationToken
等候 CancellationToken 工作完成時要觀察的 。
傳回
代表非同步作業的工作。 工作結果包含命令的結果。
適用於
ExecuteScalarAsync(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean, CancellationToken)
警告
Use overload without 'manageConnection' parameter
以非同步方式執行具有單一純量結果的命令。
public System.Threading.Tasks.Task<object> ExecuteScalarAsync (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Collections.Generic.IReadOnlyDictionary<string,object> parameterValues = default, bool manageConnection = true, System.Threading.CancellationToken cancellationToken = default);
[System.Obsolete("Use overload without 'manageConnection' parameter")]
public System.Threading.Tasks.Task<object> ExecuteScalarAsync (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Collections.Generic.IReadOnlyDictionary<string,object> parameterValues, bool manageConnection, System.Threading.CancellationToken cancellationToken = default);
abstract member ExecuteScalarAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Collections.Generic.IReadOnlyDictionary<string, obj> * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
[<System.Obsolete("Use overload without 'manageConnection' parameter")>]
abstract member ExecuteScalarAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Collections.Generic.IReadOnlyDictionary<string, obj> * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public Function ExecuteScalarAsync (connection As IRelationalConnection, Optional parameterValues As IReadOnlyDictionary(Of String, Object) = Nothing, Optional manageConnection As Boolean = true, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Public Function ExecuteScalarAsync (connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object), manageConnection As Boolean, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
參數
- connection
- IRelationalConnection
要對其執行的連線。
- parameterValues
- IReadOnlyDictionary<String,Object>
參數的值。
- manageConnection
- Boolean
值,指出是否視需要開啟和關閉連線。
- cancellationToken
- CancellationToken
等候 CancellationToken 工作完成時要觀察的 。
傳回
代表非同步作業的工作。 工作結果包含命令的結果。
- 屬性