Table of Contents

Interface IActivityTaskGroup<TOutput>

Namespace
Songhay.Abstractions
Assembly
SonghayCore.dll

A lightweight façade in front of many IActivity* implementations.

public interface IActivityTaskGroup<TOutput> where TOutput : notnull

Type Parameters

TOutput

a non-nullable value or reference type

Extension Methods

Remarks

Consider using the conventional Result types like ProgramOutputResult<TOutput> or EndpointContentResult<TContent> for TOutput.

This abstraction exposes class definitions to consumers with its TActivity type parameter. To avoid this exposure (coupling), consider implementing IActivityKeyedTaskGroup<TOutput> instead.

Methods

InvokeActivityAsync<TActivity>(CancellationToken, params string?[])

Invokes the IActivity* implementation identified by the specified key.

Task<TOutput> InvokeActivityAsync<TActivity>(CancellationToken cancellationToken, params string?[] args) where TActivity : class

Parameters

cancellationToken CancellationToken

the CancellationToken

args string[]

collects the stringified input arguments of the IActivity* implementation

Returns

Task<TOutput>

Type Parameters

TActivity

identifies the IActivity* implementation

Remarks

Note that TOutput is not marked as nullable with the expectation that *Result classes/records like EndpointResult will be used.