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
contextIExecutionContextThe execution context whose trigger data is read.
optionsJsonSerializerOptionsOptional JSON serialiser options. Uses web defaults when omitted.
Returns
- T
Type Parameters
TThe 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
contextIExecutionContextThe execution context whose trigger data is read.
valueTThe deserialised value, or default on failure.
optionsJsonSerializerOptionsOptional JSON serialiser options.
Returns
Type Parameters
TThe target CLR type.