Table of Contents

Class Derive

Namespace
Microsoft.Accordant
Assembly
Accordant.Operations.dll

Fluent API for creating request derivations.

public static class Derive
Inheritance
Derive
Inherited Members

Examples

// Types on the right (method style)
Derive.From<CreateRequest, CreateResponse, DeleteRequest>("CreateBlog")
      .When((req, resp) => resp.Success)
      .As((req, resp) => new DeleteRequest { Id = resp.Id })

// Legacy: Types on As()
Derive.From("CreateBlog")
      .As<CreateRequest, CreateResponse, DeleteRequest>((req, resp) => new DeleteRequest { Id = resp.Id })

Methods

From(string)

Start defining a derivation from a single source operation (legacy API). Types are specified on As() method instead.

public static SingleSourceDerivationBuilder From(string operationName)

Parameters

operationName string

The name of the operation to derive from.

Returns

SingleSourceDerivationBuilder

From(params string[])

Start defining a derivation from multiple source operations. Note: Multi-source derivations are not yet implemented at runtime.

public static MultiSourceDerivationBuilder From(params string[] operationNames)

Parameters

operationNames string[]

The names of the operations to derive from.

Returns

MultiSourceDerivationBuilder

From<TReq, TResp, TResult>(string)

Start defining a typed derivation from a single source operation. This is the preferred API as it enables When() filtering and cleaner As() calls.

public static TypedSingleSourceDerivationBuilder<TReq, TResp, TResult> From<TReq, TResp, TResult>(string operationName)

Parameters

operationName string

The name of the operation to derive from.

Returns

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).