Table of Contents

Class DataCommandExtensions

Namespace
FluentCommand
Assembly
FluentCommand.dll

Extension methods for IDataCommand

public static class DataCommandExtensions
Inheritance
DataCommandExtensions
Inherited Members

Methods

CommandTimeout(IDataCommand, TimeSpan)

Sets the wait time before terminating the attempt to execute a command and generating an error.

public static IDataCommand CommandTimeout(this IDataCommand dataCommand, TimeSpan timeSpan)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

timeSpan TimeSpan

The TimeSpan to wait for the command to execute.

Returns

IDataCommand

A fluent interface to the data command.

Parameter(IDataCommand, IEnumerable<DbParameter>)

Adds the parameters to the underlying command.

public static IDataCommand Parameter(this IDataCommand dataCommand, IEnumerable<DbParameter> parameters)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

parameters IEnumerable<DbParameter>

The IEnumerable`1 of DbParameter.

Returns

IDataCommand

A fluent interface to the data command.

Parameter(IDataCommand, string, object, Type)

Adds a new parameter with the specified name, value and type.

public static IDataCommand Parameter(this IDataCommand dataCommand, string name, object value, Type type)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

name string

The name of the parameter.

value object

The value to be added.

type Type

The type of the parameter.

Returns

IDataCommand

A fluent interface to the data command.

ParameterIf(IDataCommand, string, object, Type, Func<string, object, bool>)

Adds a new parameter with the specified name, value and type.

public static IDataCommand ParameterIf(this IDataCommand dataCommand, string name, object value, Type type, Func<string, object, bool> condition = null)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

name string

The name of the parameter.

value object

The value to be added.

type Type

The type of the parameter.

condition Func<string, object, bool>

Condition on if this parameter should be included

Returns

IDataCommand

A fluent interface to the data command.

ParameterIf<TParameter>(IDataCommand, string, TParameter, Func<string, TParameter, bool>)

Adds a new parameter with the specified name and value.

public static IDataCommand ParameterIf<TParameter>(this IDataCommand dataCommand, string name, TParameter value, Func<string, TParameter, bool> condition = null)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

name string

The name of the parameter.

value TParameter

The value to be added.

condition Func<string, TParameter, bool>

Condition on if this parameter should be included

Returns

IDataCommand

A fluent interface to the data command.

Type Parameters

TParameter

The type of the parameter value.

ParameterOut<TParameter>(IDataCommand, string, Action<TParameter>)

Adds a new out parameter with the specified name and callback.

public static IDataCommand ParameterOut<TParameter>(this IDataCommand dataCommand, string name, Action<TParameter> callback)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

name string

The name of the parameter.

callback Action<TParameter>

The callback used to get the out value.

Returns

IDataCommand

A fluent interface to the data command.

Type Parameters

TParameter

The type of the parameter value.

ParameterOut<TParameter>(IDataCommand, string, TParameter, Action<TParameter>)

Adds a new out parameter with the specified name, value and callback.

public static IDataCommand ParameterOut<TParameter>(this IDataCommand dataCommand, string name, TParameter value, Action<TParameter> callback)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

name string

The name of the parameter.

value TParameter

The value to be added.

callback Action<TParameter>

The callback used to get the out value.

Returns

IDataCommand

A fluent interface to the data command.

Type Parameters

TParameter

The type of the parameter value.

Parameter<TParameter>(IDataCommand, Action<IDataParameter<TParameter>>)

Adds a new parameter with the IDataParameter fluent object.

public static IDataCommand Parameter<TParameter>(this IDataCommand dataCommand, Action<IDataParameter<TParameter>> configurator)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

configurator Action<IDataParameter<TParameter>>

The delegate to configurator the IDataParameter.

Returns

IDataCommand

A fluent interface to the data command.

Type Parameters

TParameter

Parameter<TParameter>(IDataCommand, string, TParameter)

Adds a new parameter with the specified name and value.

public static IDataCommand Parameter<TParameter>(this IDataCommand dataCommand, string name, TParameter value)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

name string

The name of the parameter.

value TParameter

The value to be added.

Returns

IDataCommand

A fluent interface to the data command.

Type Parameters

TParameter

The type of the parameter value.

Return<TParameter>(IDataCommand, Action<TParameter>)

Adds a new return parameter with the specified callback.

public static IDataCommand Return<TParameter>(this IDataCommand dataCommand, Action<TParameter> callback)

Parameters

dataCommand IDataCommand

The IDataCommand for this extension method.

callback Action<TParameter>

The callback used to get the return value.

Returns

IDataCommand

A fluent interface to the data command.

Type Parameters

TParameter

The type of the parameter value.