Table of Contents

Class ExecutionContextTypedExtensions

Namespace
FlowOrchestrator.Core.Execution
Assembly
FlowOrchestrator.Core.dll

Extension methods for retrieving strongly-typed trigger data from an IExecutionContext.

public static class ExecutionContextTypedExtensions
Inheritance
ExecutionContextTypedExtensions
Inherited Members

Methods

GetTriggerDataAs<T>(IExecutionContext, JsonSerializerOptions?)

Deserialises TriggerData to T. Returns default when the data is null or cannot be converted.

public static T? GetTriggerDataAs<T>(this IExecutionContext context, JsonSerializerOptions? options = null)

Parameters

context IExecutionContext

The execution context whose trigger data is read.

options JsonSerializerOptions

Optional JSON serialiser options. Uses web defaults when omitted.

Returns

T

Type Parameters

T

The target CLR type to deserialise to.

TryGetTriggerDataAs<T>(IExecutionContext, out T?, JsonSerializerOptions?)

Tries to deserialise TriggerData to T.

public static bool TryGetTriggerDataAs<T>(this IExecutionContext context, out T? value, JsonSerializerOptions? options = null)

Parameters

context IExecutionContext

The execution context whose trigger data is read.

value T

The deserialised value, or default on failure.

options JsonSerializerOptions

Optional JSON serialiser options.

Returns

bool

true if deserialisation succeeded; otherwise false.

Type Parameters

T

The target CLR type.