WinstonPuckett.PipeExtensions 1.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package WinstonPuckett.PipeExtensions --version 1.0.0                
NuGet\Install-Package WinstonPuckett.PipeExtensions -Version 1.0.0                
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="WinstonPuckett.PipeExtensions" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WinstonPuckett.PipeExtensions --version 1.0.0                
#r "nuget: WinstonPuckett.PipeExtensions, 1.0.0"                
#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 WinstonPuckett.PipeExtensions as a Cake Addin
#addin nuget:?package=WinstonPuckett.PipeExtensions&version=1.0.0

// Install WinstonPuckett.PipeExtensions as a Cake Tool
#tool nuget:?package=WinstonPuckett.PipeExtensions&version=1.0.0                

Create an object(s) to operate on.

You need some form of starting object to pipe. This can be any class. For our example, we'll just create an Input object with an Id and an Output model with a Name.

Example:

public class Input
{
    public int Id { get; set; }
}
public class Output
{
    public string Name { get; set; }
}

Create methods which takes the object as an input.

Now that we have an object, we

public Input Validate(Input input)
{
   if (input < 0)
         throw new Exception("Id cannot be less than 0.");

    return input
}

public Output Transform(Input input)
{
    // In the real world, you would do something meaningful.
    return new Output()
    {
        Name = $"My name is input.Id"
    };
}

public void Submit(Output output)
{
    // In the real world, you would submit to a database or something.
}

Call .Pipe on the input and work through the user flow.

Now that we have data and methods to operate on that data, we can string this together into a "meaningful" user flow.

public void ExecuteUserFlow(Input input)
{
    input
        .Pipe(Validate)
        .Pipe(Transform)
        .Pipe(Submit);
}

Extra information

If you want to learn about how to use async methods with pipe extensions or why PipeExtensions was created, visit the page on GitHub.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on WinstonPuckett.PipeExtensions:

Package Downloads
RamDrive.OsfMount

A library for create virtual disk drive on system memory using (c) PassMark OSFMount software.

Krimson.Persistence.MongoDB

.NET toolkit for Kafka

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0 104 8/31/2024
1.3.0 26,748 6/11/2021
1.2.0 325 6/11/2021
1.1.0 312 5/28/2021
1.0.0 316 5/14/2021

Add all pipe operations and tests.