PipeNet, Pipelining in .Net

Ali Alp
adessoTurkey
Published in
Apr 7, 2021

--

Simplifying a complex logic with the Chain of responsibility and builder patterns

Install it from Nuget
Check out the
Repository

Usage

OrderData result= await new Pipe<OrderData>()
.Next(new OrderNode())
.Next(new ProducingNode())
.Finally(new CheckoutNode())
.Execute(new OrderData()
{
Name = "Coffee"
});

Node 1 in the pipe

public class OrderNode : Node<OrderData>
{
public override async Task<OrderData> Execute(OrderData param)
{
// Node 1's logic
return await base.Execute(param);
}
}

Node 2 in the pipe

public class ProducingNode : Node<OrderData>
{
public override async Task<OrderData> Execute(OrderData param)
{
// Node 2's logic
return await base.Execute(param);
}
}

Node 3 in the pipe

public class CheckoutNode : Node<OrderData>
{
public override async Task<OrderData> Execute(OrderData param)
{
// Node 3's logic
return await base.Execute(param);
}
}

Benchmark Summary

Install it from Nuget
Check out the
Repository

Happy coding :)

--

--

Ali Alp
adessoTurkey

“Take it easy” is nonsense , take it as hard as you can and don’t let it go :)