Table of Contents

Class TypedSingleSourceDerivationBuilder<TReq, TResp, TResult>

Namespace
Microsoft.Accordant
Assembly
Accordant.Operations.dll

Builder for typed single-source derivations with all type parameters specified upfront. This enables cleaner When() and As() calls without type parameters.

public class TypedSingleSourceDerivationBuilder<TReq, TResp, TResult>

Type Parameters

TReq

The source operation's request type.

TResp

The source operation's response type.

TResult

The derived request type (also used as template type).

Inheritance
TypedSingleSourceDerivationBuilder<TReq, TResp, TResult>
Inherited Members

Methods

As(Func<TReq, TResp, TResult, TResult>)

Define the derivation that creates a single request with template support (no filter).

public RequestDerivation As(Func<TReq, TResp, TResult, TResult> factory)

Parameters

factory Func<TReq, TResp, TResult, TResult>

Function that creates the derived request from source request/response and template.

Returns

RequestDerivation

As(Func<TReq, TResp, TResult>)

Define the derivation that creates a single request (no template, no filter).

public RequestDerivation As(Func<TReq, TResp, TResult> factory)

Parameters

factory Func<TReq, TResp, TResult>

Function that creates the derived request from source request/response.

Returns

RequestDerivation

AsVariants(Func<TReq, TResp, Dictionary<string, TResult>>)

Define a derivation that produces multiple request variants (no template, no filter). Use this for cases like generating both IfMatch and IfNoneMatch requests.

public RequestDerivation AsVariants(Func<TReq, TResp, Dictionary<string, TResult>> factory)

Parameters

factory Func<TReq, TResp, Dictionary<string, TResult>>

Function that creates a dictionary of variant label to derived request.

Returns

RequestDerivation

AsVariants(Func<TReq, TResp, TResult, Dictionary<string, TResult>>)

Define a derivation that produces multiple request variants with template support (no filter).

public RequestDerivation AsVariants(Func<TReq, TResp, TResult, Dictionary<string, TResult>> factory)

Parameters

factory Func<TReq, TResp, TResult, Dictionary<string, TResult>>

Function that creates a dictionary of variant label to derived request.

Returns

RequestDerivation

When(Func<TReq, TResp, bool>)

Add a filter condition. Derivation is skipped when predicate returns false.

public TypedWhenBuilder<TReq, TResp, TResult> When(Func<TReq, TResp, bool> predicate)

Parameters

predicate Func<TReq, TResp, bool>

Condition that must be true for derivation to proceed.

Returns

TypedWhenBuilder<TReq, TResp, TResult>