feat: made PipelineBase.AddDependency be a params

This commit is contained in:
D. Moonfire 2023-01-15 12:20:41 -06:00
parent 084aa7e812
commit a8c6d0e582
6 changed files with 33 additions and 17 deletions

View file

@ -25,7 +25,10 @@ public class ForEachHandlebarsBlock<TModel> : HandlebarsBlockBase
/// </summary> /// </summary>
public Action<EncodedTextWriter, BlockHelperOptions, Context, Arguments>? public Action<EncodedTextWriter, BlockHelperOptions, Context, Arguments>?
NothingFound NothingFound
{ get; set; } {
get;
set;
}
/// <inheritdoc /> /// <inheritdoc />
protected override string HelperName { get; } protected override string HelperName { get; }

View file

@ -32,7 +32,10 @@ public class ParseYamlHeader<TModel> : OperationBase
public Func<Entity, string, Exception, ParseYamlHeaderErrorHandling>? public Func<Entity, string, Exception, ParseYamlHeaderErrorHandling>?
EntityError EntityError
{ get; set; } {
get;
set;
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the header should be removed /// Gets or sets a value indicating whether the header should be removed

View file

@ -16,9 +16,19 @@ public abstract class PipelineBase : IPipeline
this.dependencies = new List<IPipeline>(); this.dependencies = new List<IPipeline>();
} }
public PipelineBase AddDependency(IPipeline pipeline) /// <summary>
/// Adds one or more pipeline dependencies into the current one. All of
/// the dependencies are guaranteed to run before this pipeline's RunAsync
/// is called.
/// </summary>
/// <param name="pipelines">The pipelines to add as a dependency.</param>
/// <returns>The same object for chaining operations.</returns>
public PipelineBase AddDependency(params IPipeline[] pipelines)
{
foreach (IPipeline pipeline in pipelines)
{ {
this.dependencies.Add(pipeline); this.dependencies.Add(pipeline);
}
return this; return this;
} }