Flaminco.Pipeline 0.0.3

dotnet add package Flaminco.Pipeline --version 0.0.3                
NuGet\Install-Package Flaminco.Pipeline -Version 0.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Flaminco.Pipeline" Version="0.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Flaminco.Pipeline --version 0.0.3                
#r "nuget: Flaminco.Pipeline, 0.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Flaminco.Pipeline as a Cake Addin
#addin nuget:?package=Flaminco.Pipeline&version=0.0.3

// Install Flaminco.Pipeline as a Cake Tool
#tool nuget:?package=Flaminco.Pipeline&version=0.0.3                

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<Example>(Order = 1)]
   public class AddingOnePipeline: IPipelineHandler<Example>
   {
       public ValueTask Handler(Example source, CancellationToken cancellationToken = default)
       {
           source.Value = 1;
           
           return ValueTask.CompletedTask;
       }
   }
   
   [Pipeline<Example>(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, cancellationToken);
           
           return newExample;
       }
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.3 189 7/1/2023
0.0.2 327 1/4/2023
0.0.1 315 12/30/2022