Jcd.DoWhenRun 1.0.2 The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved

Install-Package Jcd.DoWhenRun -Version 1.0.2
dotnet add package Jcd.DoWhenRun --version 1.0.2
<PackageReference Include="Jcd.DoWhenRun" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jcd.DoWhenRun --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jcd.DoWhenRun, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Jcd.DoWhenRun as a Cake Addin
#addin nuget:?package=Jcd.DoWhenRun&version=1.0.2

// Install Jcd.DoWhenRun as a Cake Tool
#tool nuget:?package=Jcd.DoWhenRun&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Jcd.DoWhenRun

A netstandard 1.0 set of extension methods, Do, DoWhen and Run, that give a Fluent builder-pattern-like experience to operating on IEnumerable and IEnumerable<T> derived types.

Do

Do sets up an operation to perform on every item it iterates across.

DoWhen

DoWhen sets up an operation to perform on every item it iterates across that matches the predicate.

Run

Run enumerates an IEnumerable and therefore causes execution of the the code configured in Do and DoWhen blocks.

Example

    (from x in Enumerable.Range(0, 4)
     from y in Enumerable.Range(0, 4)
     select (x, y))
        .DoWhen((i,_)=>i > 0 && i % 4 == 0, (_,_)=>Console.WriteLine())
        .Do(t=>Console.Write(t))
        .Run();

    Console.WriteLine();
    
    /* outputs:
        (0, 0)(0, 1)(0, 2)(0, 3)
        (1, 0)(1, 1)(1, 2)(1, 3)
        (2, 0)(2, 1)(2, 2)(2, 3)
        (3, 0)(3, 1)(3, 2)(3, 3)            
    */            

GitHub Build status CodeFactor Grade

MyGet Nuget

API Docs

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
1.0.2 139 10/16/2021
1.0.1 131 10/16/2021