ReqRest
Show / Hide Table of Contents

Class BuilderExtensions

Provides extension methods that are available for every single IBuilder provided by the library.

Inheritance
Object
BuilderExtensions
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 builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • configure

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 to be executed.

Action<T> action

An action to be executed if the condition is true. This action receives the this builder instance as its parameter.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • action

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 to be executed.

Action<T> action

An action to be executed if the condition is false. This action receives the this builder instance as its parameter.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • action
Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)