Method AddParameterType
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
AddParameterType(IDbCommand, string?, DbType, ParameterDirection)
Adds a parameter of the given type and direction to the command without assigning a value.
public static IDbDataParameter AddParameterType(this IDbCommand target, string? name, DbType type, ParameterDirection direction = ParameterDirection.Input)
Parameters
targetIDbCommandThe command to add the parameter to.
namestringThe name of the parameter. It can be null only when
directionis ReturnValue.typeDbTypeThe DbType of the parameter.
directionParameterDirectionThe direction of the parameter.
Returns
- IDbDataParameter
The created parameter, which has already been added to the command's parameter collection. Set its value afterwards if it is an input parameter.
Exceptions
- ArgumentNullException
targetis null, ornameis null anddirectionis not ReturnValue.- ArgumentException
nameis empty or white space.