Class BuilderExtensions
Provides extension methods that are available for every single IBuilder provided by the library.
Namespace: ReqRest.Builders
Assembly: ReqRest.dll
Syntax
public static class BuilderExtensions
Methods
Configure<T>(T, Action<T>)
Executes the specified configure
function to configure or modify
this builder instance.
Declaration
public static T Configure<T>(this T builder, Action<T> configure)
where T : IBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Action<T> | configure | A function which receives this builder instance as its parameter. |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
If<T>(T, Boolean, Action<T>)
Executes the specified action
to configure or modify this
builder instance, but only if the condition
is true.
Declaration
public static T If<T>(this T builder, bool condition, Action<T> action)
where T : IBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Boolean | condition | A condition which must be true for the |
Action<T> | action | An action to be executed if the |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IfNot<T>(T, Boolean, Action<T>)
Executes the specified action
to configure or modify this
builder instance, but only if the condition
is false.
Declaration
public static T IfNot<T>(this T builder, bool condition, Action<T> action)
where T : IBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Boolean | condition | A condition which must be false for the |
Action<T> | action | An action to be executed if the |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|