Flaminco.Pipeline
0.0.2
See the version list below for details.
dotnet add package Flaminco.Pipeline --version 0.0.2
NuGet\Install-Package Flaminco.Pipeline -Version 0.0.2
<PackageReference Include="Flaminco.Pipeline" Version="0.0.2" />
paket add Flaminco.Pipeline --version 0.0.2
#r "nuget: Flaminco.Pipeline, 0.0.2"
// Install Flaminco.Pipeline as a Cake Addin #addin nuget:?package=Flaminco.Pipeline&version=0.0.2 // Install Flaminco.Pipeline as a Cake Tool #tool nuget:?package=Flaminco.Pipeline&version=0.0.2
#Introduction
This package should be used for cases that when you want to apply a set of rules and you want these rules to have an effect to your object, in that case you should think about using this package. By applying the Pipeline design pattern, each pipe will have an effect on your source object based on your custom logic in each pipe.
#Getting Started
1- Inject into your DI
builder.Services.AddPipelines<IPipelinesScanner>();
2- Define your object
public class Example
{
public int Value { get; set; }
}
3- Define a pipe handler
using Pipeline attribute to define some metadata, such as the pipeline group name and the order of execution.
[Pipeline(Name = "GroupName", Order = 1)]
public class AddingOnePipeline: IPipelineHandler<Example>
{
public ValueTask Handler(Example source, CancellationToken cancellationToken = default)
{
source.Value = 1;
return ValueTask.CompletedTask;
}
}
[Pipeline(Name = "GroupName", Order = 2)]
public class AddingTwoPipeline: IPipelineHandler<Example>
{
public ValueTask Handler(Example source, CancellationToken cancellationToken = default)
{
source.Value = 2;
return ValueTask.CompletedTask;
}
}
4- Fire the pipeline engine
private readonly IPipeline _pipeline;
public DemoController(IPipeline pipeline)
{
_pipeline = pipeline;
}
[HttpGet(Name = "GetWeatherForecast")]
public async Task<Example> Get()
{
Example example = new Example
{
Value = 0
};
Example newExample = await _pipeline.ExecutePipeline(example, "GroupName", cancellationToken);
return newExample;
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.