Class TaskResultOutputAccessor
Provides an easy accessor for task output results.
Assembly: Taskurai.dll
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.
public ResultOutput this[string name] { get; }
Methods
GetOutput()
Gets the output.
When more than one return value is available, an exception is thrown.
public ResultOutput GetOutput()
Returns
Taskurai.Models.ResultOutput: The output if found; otherwise, null.### GetOutput(string)
Gets the output by its name.
public ResultOutput GetOutput(string name)
Returns
Taskurai.Models.ResultOutput: The output if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the output. |
GetStateReference()
Gets the output state reference.
When more than one return value is available, an exception is thrown.
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.
public StateReference GetStateReference(string name)
Returns
Taskurai.Models.StateReference: The output state reference if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The 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.
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
| Type | Name | Description |
|---|---|---|
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
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
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the output. |
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
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.
public string ToString(string name)
Returns
System.String: The value of the output value as string if found; otherwise, otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The 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.
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
| Type | Name | Description |
|---|---|---|
| Taskurai.Models.ResultOutput | output | The output. |
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The type to deserialized the output's value to. |
GetOutputsByType<T>(string)
Gets all output values that match the specified type.
public ResultOutput[] GetOutputsByType<T>(string type)
Returns
Taskurai.Models.ResultOutput[]: An array of output results.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | type | Type of the output |
Type Parameters
T
GetStateReferencesByType<T>(string)
Gets all output state references that match the specified type.
public StateReference[] GetStateReferencesByType<T>(string type)
Returns
Taskurai.Models.StateReference[]: An array of state references.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | type | Type 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.
public T[] GetValuesByType<T>(string type, JsonSerializerOptions options = null)
Returns
<T>[]: An array of output values deserialized to the specified type T.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | type | Type of the output |
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The type to deserialized the output's value to. |
GetEnumerator()
Returns an enumerator that iterates through the collection of Taskurai.Models.ResultOutput.
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