Share via


IRelationalCommand.ExecuteScalar Method

Definition

Overloads

ExecuteScalar(RelationalCommandParameterObject)

Executes the command with a single scalar result.

ExecuteScalar(IRelationalConnection, IReadOnlyDictionary<String,Object>)

Executes the command with a single scalar result.

ExecuteScalar(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean)
Obsolete.

Executes the command with a single scalar result.

ExecuteScalar(RelationalCommandParameterObject)

Executes the command with a single scalar result.

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

Parameters

parameterObject
RelationalCommandParameterObject

Parameters for this method.

Returns

The result of the command.

Applies to

ExecuteScalar(IRelationalConnection, IReadOnlyDictionary<String,Object>)

Executes the command with a single scalar result.

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

Parameters

connection
IRelationalConnection

The connection to execute against.

parameterValues
IReadOnlyDictionary<String,Object>

The values for the parameters.

Returns

The result of the command.

Applies to

ExecuteScalar(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean)

Caution

Use overload without 'manageConnection' parameter

Executes the command with a single scalar result.

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

Parameters

connection
IRelationalConnection

The connection to execute against.

parameterValues
IReadOnlyDictionary<String,Object>

The values for the parameters.

manageConnection
Boolean

A value indicating whether to open and close the connection as needed.

Returns

The result of the command.

Attributes

Applies to