Table of Contents

Method AddParamIf

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

AddParamIf(bool, string, object, TDbType, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf(bool condition, string name, object value, TDbType type, ParameterDirection direction = ParameterDirection.Input)

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

value object

The value of the parameter.

type TDbType

The database type of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf<T>(bool, string, T?, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf<T>(bool condition, string name, T? value, ParameterDirection direction = ParameterDirection.Input) where T : struct

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

value T?

The value of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Type Parameters

T

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf(bool, string, object?, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf(bool condition, string name, object? value, ParameterDirection direction = ParameterDirection.Input)

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

value object

The value of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf<T>(bool, string, T?, TDbType?, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf<T>(bool condition, string name, T? value, TDbType? type, ParameterDirection direction = ParameterDirection.Input) where T : struct

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

value T?

The value of the parameter.

type TDbType?

The database type of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Type Parameters

T

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf(bool, string, int, TDbType?, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf(bool condition, string name, int value, TDbType? type = null, ParameterDirection direction = ParameterDirection.Input)

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

value int

The value of the parameter.

type TDbType?

The database type of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf(bool, string, long, TDbType?, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf(bool condition, string name, long value, TDbType? type = null, ParameterDirection direction = ParameterDirection.Input)

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

value long

The value of the parameter.

type TDbType?

The database type of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf(bool, string, TDbType, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf(bool condition, string name, TDbType type, ParameterDirection direction = ParameterDirection.Input)

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

type TDbType

The database type of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.

AddParamIf(bool, string, ParameterDirection)

Conditionally adds a parameter to the params list.

public TThis AddParamIf(bool condition, string name, ParameterDirection direction = ParameterDirection.Input)

Parameters

condition bool

The condition to add the param by. Only adds if true.

name string

The name of the parameter.

direction ParameterDirection

The direction of the parameter.

Returns

TThis

This instance for use in method chaining.

Exceptions

ArgumentNullException

name is null.

ArgumentException

name is blank.