Skip to main content

Class TaskResultOutputAccessor

Provides an easy accessor for task output results.

Assembly: Taskurai.dll​
Declaration
public class TaskResultOutputAccessor : IEnumerable<ResultOutput>, IEnumerable

Implements:
System.Collections.Generic.IEnumerable<Taskurai.Models.ResultOutput>, System.Collections.IEnumerable

Properties​

this[string]​

Gets the output by its name.

Declaration
public ResultOutput this[string name] { get; }

Methods​

GetOutput()​

Gets the output.

When more than one return value is available, an exception is thrown.

Declaration
public ResultOutput GetOutput()
Returns​

Taskurai.Models.ResultOutput: The output if found; otherwise, null.### GetOutput(string) Gets the output by its name.

Declaration
public ResultOutput GetOutput(string name)
Returns​

Taskurai.Models.ResultOutput: The output if found; otherwise, null.

Parameters​
TypeNameDescription
System.StringnameThe name of the output.

GetStateReference()​

Gets the output state reference.

When more than one return value is available, an exception is thrown.

Declaration
public StateReference GetStateReference()
Returns​

Taskurai.Models.StateReference: The output state reference if found; otherwise, null.### GetStateReference(string) Gets the output state reference by its name.

Declaration
public StateReference GetStateReference(string name)
Returns​

Taskurai.Models.StateReference: The output state reference if found; otherwise, null.

Parameters​
TypeNameDescription
System.StringnameThe name of the output.

GetValue<T>(JsonSerializerOptions)​

Gets the output value and attempts to deserialized it to the specified type.

When more than one return value is available, an exception is thrown.

When the output is a state reference, an exception is thrown.

Declaration
public T GetValue<T>(JsonSerializerOptions options = null)
Returns​

<T>: The value of the output deserialized to specified type T if found; otherwise, the default value.

Parameters​
TypeNameDescription
System.Text.Json.JsonSerializerOptionsoptionsThe System.Text.Json.JsonSerializerOptions to use when serializing to JSON.
Type Parameters​
NameDescription
TThe type to deserialized the output's value to.

GetValue<T>(string, JsonSerializerOptions)​

Gets the output value by its name and attempts to deserialized it to the specified type.

When the output is a state reference, an exception is thrown.

Declaration
public T GetValue<T>(string name, JsonSerializerOptions options = null)
Returns​

<T>: The value of the output deserialized to specified type T if found; otherwise, the default value.

Parameters​
TypeNameDescription
System.StringnameThe name of the output.
System.Text.Json.JsonSerializerOptionsoptionsThe System.Text.Json.JsonSerializerOptions to use when serializing to JSON.
Type Parameters​
NameDescription
TThe type to deserialized the output's value to.

ToString()​

Gets the output string value and attempts to deserialized it to the specified type.

When more than one return value is available, an exception is thrown.

When the output is a state reference, an exception is thrown.

Declaration
public override string ToString()
Returns​

System.String: The value of the output value as string if found; otherwise, otherwise, null.### ToString(string) Gets the output string value by its name and attempts to deserialized it to the specified type.

When the output is a state reference, an exception is thrown.

Declaration
public string ToString(string name)
Returns​

System.String: The value of the output value as string if found; otherwise, otherwise, null.

Parameters​
TypeNameDescription
System.StringnameThe name of the output.

GetValue<T>(ResultOutput, JsonSerializerOptions)​

Gets the output value and attempts to deserialized it to the specified type.

When the output is a state reference, an exception is thrown.

Declaration
protected T GetValue<T>(ResultOutput output, JsonSerializerOptions options = null)
Returns​

<T>: The value of the output deserialized to specified type T if found; otherwise, the default value.

Parameters​
TypeNameDescription
Taskurai.Models.ResultOutputoutputThe output.
System.Text.Json.JsonSerializerOptionsoptionsThe System.Text.Json.JsonSerializerOptions to use when serializing to JSON.
Type Parameters​
NameDescription
TThe type to deserialized the output's value to.

GetOutputsByType<T>(string)​

Gets all output values that match the specified type.

Declaration
public ResultOutput[] GetOutputsByType<T>(string type)
Returns​

Taskurai.Models.ResultOutput[]: An array of output results.

Parameters​
TypeNameDescription
System.StringtypeType of the output
Type Parameters​
  • T

GetStateReferencesByType<T>(string)​

Gets all output state references that match the specified type.

Declaration
public StateReference[] GetStateReferencesByType<T>(string type)
Returns​

Taskurai.Models.StateReference[]: An array of state references.

Parameters​
TypeNameDescription
System.StringtypeType of the output
Type Parameters​
  • T

GetValuesByType<T>(string, JsonSerializerOptions)​

Gets all output values that match the specified type.

When the output is a state reference, an exception is thrown.

Declaration
public T[] GetValuesByType<T>(string type, JsonSerializerOptions options = null)
Returns​

<T>[]: An array of output values deserialized to the specified type T.

Parameters​
TypeNameDescription
System.StringtypeType of the output
System.Text.Json.JsonSerializerOptionsoptionsThe System.Text.Json.JsonSerializerOptions to use when serializing to JSON.
Type Parameters​
NameDescription
TThe type to deserialized the output's value to.

GetEnumerator()​

Returns an enumerator that iterates through the collection of Taskurai.Models.ResultOutput.

Declaration
public IEnumerator<ResultOutput> GetEnumerator()
Returns​

System.Collections.Generic.IEnumerator<Taskurai.Models.ResultOutput>: An enumerator for the collection of output results.

Implements​

  • System.Collections.Generic.IEnumerable<Taskurai.Models.ResultOutput>
  • System.Collections.IEnumerable