Table of Contents

Method AddReturnParameter

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

AddReturnParameter(IDbCommand, DbType, string?)

Adds a typed return-value parameter to the command.

public static IDbDataParameter AddReturnParameter(this IDbCommand target, DbType type, string? name = null)

Parameters

target IDbCommand

The command to add the parameter to.

type DbType

The DbType of the parameter.

name string

The optional name of the parameter.

Returns

IDbDataParameter

The created parameter, which has already been added to the command's parameter collection. Read its value after the command has executed.

Exceptions

ArgumentNullException

target is null.

ArgumentException

name is empty or white space.

AddReturnParameter(IDbCommand, string?)

Adds a return-value parameter to the command, leaving the provider to determine its type.

public static IDbDataParameter AddReturnParameter(this IDbCommand target, string? name = null)

Parameters

target IDbCommand

The command to add the parameter to.

name string

The optional name of the parameter. It is ignored if it is null, empty, or white space.

Returns

IDbDataParameter

The created parameter, which has already been added to the command's parameter collection. Read its value after the command has executed.

Exceptions

ArgumentNullException

target is null.