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
targetIDbCommandThe command to add the parameter to.
typeDbTypeThe DbType of the parameter.
namestringThe 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
targetis null.- ArgumentException
nameis 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
targetIDbCommandThe command to add the parameter to.
namestringThe 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
targetis null.