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 :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

adessoTurkey
adessoTurkey

Published in adessoTurkey

adesso Turkey brings inventors, engineers and designers together to create digital products, provide continuity through quality assurance and offer custom software development & IT solutions.

Ali Alp
Ali Alp

Written by Ali Alp

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

No responses yet

Write a response