Class Derive
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
operationNamestringThe name of the operation to derive from.
Returns
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
operationNamesstring[]The names of the operations to derive from.
Returns
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
operationNamestringThe name of the operation to derive from.
Returns
- TypedSingleSourceDerivationBuilder<TReq, TResp, TResult>
Type Parameters
TReqThe source operation's request type.
TRespThe source operation's response type.
TResultThe derived request type (also used as template type).