CSharp.Pipe 1.0.1

Enabeling Piping in c#

Install-Package CSharp.Pipe -Version 1.0.1
dotnet add package CSharp.Pipe --version 1.0.1
<PackageReference Include="CSharp.Pipe" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSharp.Pipe --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CSharp.Pipe

This lib is made to bring piping to c#.
It dos not add any functionality but it makes the code more readable. Its just syntactic sugar!

Use

lets say you have these functions :

    private int _val = 6;

    private int GetById(int id) => _val;
    private static Func<int, int> Add(int x) => y => x + y;

    private Action<int> Save(int id ) => val => _val = val;

and if you want to:

GetById 'id' and add 2 and save the new value for id

normally if would lock like

    const int id = 2;
    var v = GetById(id);
    v = Add(v)(2);
    Save(id)(v);

but with the piping it looks like

    const int id = 2;
    GetById(id)
        .Pipe(Add(2))
        .Pipe(Save(id));

With the pipe it reads more natural. More examples are in the tests

Install

Install-Package CSharp.Pipe 
dotnet add package CSharp.Pipe

CSharp.Pipe

This lib is made to bring piping to c#.
It dos not add any functionality but it makes the code more readable. Its just syntactic sugar!

Use

lets say you have these functions :

    private int _val = 6;

    private int GetById(int id) => _val;
    private static Func<int, int> Add(int x) => y => x + y;

    private Action<int> Save(int id ) => val => _val = val;

and if you want to:

GetById 'id' and add 2 and save the new value for id

normally if would lock like

    const int id = 2;
    var v = GetById(id);
    v = Add(v)(2);
    Save(id)(v);

but with the piping it looks like

    const int id = 2;
    GetById(id)
        .Pipe(Add(2))
        .Pipe(Save(id));

With the pipe it reads more natural. More examples are in the tests

Install

Install-Package CSharp.Pipe 
dotnet add package CSharp.Pipe

Release Notes

targetFraimWork 2.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 353 5/16/2018
1.0.0 349 3/8/2018