IRelationalCommand.ExecuteScalar 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ExecuteScalar(RelationalCommandParameterObject)
使用單一純量結果執行命令。
public object ExecuteScalar (Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject parameterObject);
public object? ExecuteScalar (Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject parameterObject);
abstract member ExecuteScalar : Microsoft.EntityFrameworkCore.Storage.RelationalCommandParameterObject -> obj
Public Function ExecuteScalar (parameterObject As RelationalCommandParameterObject) As Object
參數
- parameterObject
- RelationalCommandParameterObject
這個方法的參數。
傳回
命令的結果。
適用於
ExecuteScalar(IRelationalConnection, IReadOnlyDictionary<String,Object>)
使用單一純量結果執行命令。
public object ExecuteScalar (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Collections.Generic.IReadOnlyDictionary<string,object> parameterValues);
abstract member ExecuteScalar : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Collections.Generic.IReadOnlyDictionary<string, obj> -> obj
Public Function ExecuteScalar (connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object)) As Object
參數
- connection
- IRelationalConnection
要對其執行的連線。
- parameterValues
- IReadOnlyDictionary<String,Object>
參數的值。
傳回
命令的結果。
適用於
ExecuteScalar(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean)
警告
Use overload without 'manageConnection' parameter
使用單一純量結果執行命令。
public object ExecuteScalar (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Collections.Generic.IReadOnlyDictionary<string,object> parameterValues = default, bool manageConnection = true);
[System.Obsolete("Use overload without 'manageConnection' parameter")]
public object ExecuteScalar (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Collections.Generic.IReadOnlyDictionary<string,object> parameterValues, bool manageConnection);
abstract member ExecuteScalar : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Collections.Generic.IReadOnlyDictionary<string, obj> * bool -> obj
[<System.Obsolete("Use overload without 'manageConnection' parameter")>]
abstract member ExecuteScalar : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Collections.Generic.IReadOnlyDictionary<string, obj> * bool -> obj
Public Function ExecuteScalar (connection As IRelationalConnection, Optional parameterValues As IReadOnlyDictionary(Of String, Object) = Nothing, Optional manageConnection As Boolean = true) As Object
Public Function ExecuteScalar (connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object), manageConnection As Boolean) As Object
參數
- connection
- IRelationalConnection
要對其執行的連線。
- parameterValues
- IReadOnlyDictionary<String,Object>
參數的值。
- manageConnection
- Boolean
值,指出是否視需要開啟和關閉連線。
傳回
命令的結果。
- 屬性