Open sandboxFocus

Method SetParameter

SetParameter<T>(int, string, ParameterKind, string, T)

Sets the value of a given parameter and uses the default formatter.

Declaration
public void SetParameter<T>(int index, string parameterName, ParameterKind parameterKind, string typeName, T value)
Parameters
Type Name Description
int index

The index of the parameter in the list of method parameters.

string parameterName

The name of the parameter. It is included only if the IncludeParameterName property is true.

ParameterKind parameterKind

The kind of the parameter. It specifies whether the parameter is by reference or by value, and whether it is an input or an output parameter.

string typeName

The formatted name of the type T. It is included only if the IncludeParameterType property is true.

T value

The value of the parameter. It is included only if the IncludeParameterValue property is true.

Type Parameters
Name Description
T

The type of the parameter.

Remarks

The return value is set by the method SetReturnValue<T>(int, string, string, T). Thus the value of the parameterKind is never ReturnValue or ReturnRef.

SetParameter<T>(int, string, ParameterKind, string, T, IFormatter<T>)

Sets the value of a given parameter and specifies the Formatter<T>.

Declaration
public virtual void SetParameter<T>(int index, string parameterName, ParameterKind parameterKind, string typeName, T value, IFormatter<T> formatter)
Parameters
Type Name Description
int index

The index of the parameter in the list of method parameters.

string parameterName

The name of the parameter. It is included only if the IncludeParameterName property is true.

ParameterKind parameterKind

The kind of the parameter. It specifies whether the parameter is by reference or by value, and whether it is an input or an output parameter.

string typeName

The formatted name of the type T. It is included only if the IncludeParameterType property is true.

T value

The value of the parameter. It is included only if the IncludeParameterValue property is true.

IFormatter<T> formatter

The formatter to be used to format value.

Type Parameters
Name Description
T

The type of the parameter.

Remarks

The return value is set by the method SetReturnValue<T>(int, string, string, T, IFormatter<T>). Thus the value of the parameterKind is never ReturnValue or ReturnRef.