Table of Contents

Class MetadataInputExtensions

Namespace
FlowOrchestrator.Core.Abstractions
Assembly
FlowOrchestrator.Core.dll

Extension methods for extracting typed values from step or trigger input dictionaries. Handles both strongly-typed CLR values and JsonElement representations, which occur when inputs are deserialized from JSON manifests.

public static class MetadataInputExtensions
Inheritance
MetadataInputExtensions
Inherited Members

Methods

TryGetBoolean(IDictionary<string, object?>, string, out bool)

Tries to read a boolean from inputs at key, accepting native bool, JSON true/false literals, and parseable strings.

public static bool TryGetBoolean(this IDictionary<string, object?> inputs, string key, out bool value)

Parameters

inputs IDictionary<string, object>

The input dictionary to read from.

key string

The input key to look up.

value bool

The parsed boolean, or false if not found.

Returns

bool

true if a valid boolean was found; otherwise false.

TryGetDateTimeOffset(IDictionary<string, object?>, string, out DateTimeOffset)

Tries to read a DateTimeOffset from inputs at key. Accepts ISO 8601 strings and JsonElement string values; parses with round-trip kind.

public static bool TryGetDateTimeOffset(this IDictionary<string, object?> inputs, string key, out DateTimeOffset value)

Parameters

inputs IDictionary<string, object>

The input dictionary to read from.

key string

The input key to look up.

value DateTimeOffset

The parsed DateTimeOffset, or default if not found.

Returns

bool

true if a valid date/time was found; otherwise false.

TryGetInt32(IDictionary<string, object?>, string, out int)

Tries to read a 32-bit integer from inputs at key, accepting int, long (within range), and numeric or string JsonElement values.

public static bool TryGetInt32(this IDictionary<string, object?> inputs, string key, out int value)

Parameters

inputs IDictionary<string, object>

The input dictionary to read from.

key string

The input key to look up.

value int

The parsed integer, or 0 if not found or conversion fails.

Returns

bool

true if a valid integer was found; otherwise false.

TryGetString(IDictionary<string, object?>, string, out string)

Tries to read a string value from inputs at key, normalising numeric and boolean JsonElement variants to their string forms.

public static bool TryGetString(this IDictionary<string, object?> inputs, string key, out string value)

Parameters

inputs IDictionary<string, object>

The input dictionary to read from.

key string

The input key to look up.

value string

The resolved string value, or Empty if not found.

Returns

bool

true if a non-whitespace value was found; otherwise false.