1using System.Collections.Generic;
13 public Dictionary<string, object>
Inputs {
get; } =
new Dictionary<string, object>();
18 public Dictionary<string, object>
Outputs {
get; } =
new Dictionary<string, object>();
31 Inputs =
new Dictionary<string, object>(inputs);
41 if (
Outputs.TryGetValue(key, out var value))
43 if (value is T outputValue)
45 throw new System.InvalidCastException($
"Invalid cast for argument: {key}. Attempted to cast {value.GetType()} to {typeof(T)}.");
48 if (
Inputs[key] is T inputValue)
50 throw new System.InvalidCastException($
"Invalid cast for argument: {key}. Attempted to cast {Inputs[key].GetType()} to {typeof(T)}.");
59 if (
Inputs[key] is T value)
61 throw new System.InvalidCastException($
"Invalid cast for argument: {key}. Attempted to cast {Inputs[key].GetType()} to {typeof(T)}.");
72 throw new System.InvalidCastException($
"Invalid cast for argument: {key}. Attempted to cast {Outputs[key].GetType()} to {typeof(T)}.");
A container for holding pipeline results.
PipelineResults(Dictionary< string, object > inputs)
Initializes a new result.
bool Success
True if the pipeline steps are successful.
void Complete()
Marks the pipeline as successful.
void AddOutput< T >(string key, T value)
Adds the value to the outputs dictionary. Raises an exception if the key already exists.
T GetOutput< T >(string key)
Returns the output for the specified key.
T GetInput< T >(string key)
Returns the input for the specified key.
Dictionary< string, object > Inputs
A dictionary of pipeline inputs.
T GetArgument< T >(string key)
Searches the output and input dictionaries for the key and returns it.
void SetOutput< T >(string key, T value)
Sets the value to the outputs dictionary.
Dictionary< string, object > Outputs
A dictionary of pipeline output results.