Soenneker.Extensions.Enumerable 1.0.8

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.Enumerable --version 1.0.8
NuGet\Install-Package Soenneker.Extensions.Enumerable -Version 1.0.8
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="Soenneker.Extensions.Enumerable" Version="1.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.Extensions.Enumerable --version 1.0.8
#r "nuget: Soenneker.Extensions.Enumerable, 1.0.8"
#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 Soenneker.Extensions.Enumerable as a Cake Addin
#addin nuget:?package=Soenneker.Extensions.Enumerable&version=1.0.8

// Install Soenneker.Extensions.Enumerable as a Cake Tool
#tool nuget:?package=Soenneker.Extensions.Enumerable&version=1.0.8

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Extensions.Enumerable

A collection of helpful enumerable extension methods

Installation

Install-Package Soenneker.Extensions.Enumerable

Usage

IEnumerable should have IsNullOrEmpty() too

var populatedList = new List<string>{"foo", "bar", "foo"};

populatedList.IsNullOrEmpty() // false

populatedList.Populated() // true
populatedList.None() // false

One call checking for null and contains any elements

List<string>? nullList = null;

nullList.IsNullOrEmpty() // true
nullList.Populated() // false

Duplicate handling

var containsDuplicates = populatedList.ContainsDuplicates(); // true

var deduped = populatedList.RemoveDuplicates(); // {"foo", "bar"}

Recursive flattening

public class Node 
{
    public string Name {get; set;}
    public List<Node> Children {get; set;}
}

void Example()
{
    var node = new Node(){ Name = "Node1" };
    node.Children = new List()
    {
        new Node() 
        {
            Name = "Node2"
        }
    }

    List<Node>? children = node.Children.ToFlattenedFromRecursive(c => c.Children);

    // Results in flattened List:
    // { Node1, Node2 }
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Soenneker.Extensions.Enumerable:

Package Downloads
Soenneker.Utils.SingletonDictionary The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

An externally initializing singleton dictionary that uses double-check asynchronous locking, with optional async and sync disposal

Soenneker.Utils.String The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A utility library for useful String operations

Soenneker.Swashbuckle.Authentication The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A middleware implementing basic authentication and RBAC support for Swashbuckle (Swagger)

Soenneker.Utils.Network The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A utility library of helpful network related operations

Soenneker.Utils.Process The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A utility library implementing useful process operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.61 35,703 5/25/2024
2.1.60 69 5/25/2024
2.1.59 368 5/25/2024
2.1.58 10,133 5/22/2024
2.1.57 74 5/22/2024
2.1.56 8,329 5/17/2024
2.1.55 11,164 4/30/2024
2.1.54 11,450 4/28/2024
2.1.53 77 4/28/2024
2.1.52 480 4/27/2024
2.1.51 82 4/27/2024
2.1.50 18,338 4/12/2024
2.1.49 987 4/12/2024
2.1.48 76 4/12/2024
2.1.47 26,187 3/18/2024
2.1.46 6,488 3/13/2024
2.1.45 1,663 3/13/2024
2.1.44 45,711 2/21/2024
2.1.43 2,062 2/21/2024
2.1.42 80 2/21/2024
2.1.41 16,666 2/16/2024
2.1.40 481 2/16/2024
2.1.39 18,468 2/9/2024
2.1.38 14,658 2/6/2024
2.1.37 80 2/6/2024
2.1.36 49,768 1/15/2024
2.1.35 634 1/15/2024
2.1.34 21,335 1/5/2024
2.1.33 1,977 1/5/2024
2.1.32 10,869 12/27/2023
2.1.31 1,115 12/27/2023
2.1.30 857 12/27/2023
2.1.29 6,115 12/25/2023
2.1.28 1,094 12/25/2023
2.1.27 586 12/25/2023
2.1.26 8,291 12/23/2023
2.1.25 94 12/23/2023
2.1.24 675 12/23/2023
2.1.23 16,451 12/9/2023
2.1.22 1,154 12/9/2023
2.1.21 184 12/9/2023
2.1.20 1,457 12/9/2023
2.1.19 8,612 12/4/2023
2.1.18 679 12/4/2023
2.1.17 4,051 11/26/2023
2.1.16 4,340 11/23/2023
2.1.15 232 11/23/2023
2.1.14 627 11/23/2023
2.1.13 7,298 11/19/2023
2.1.12 102 11/19/2023
2.1.11 854 11/18/2023
2.1.10 2,682 11/18/2023
2.1.9 1,583 11/18/2023
2.1.8 2,859 11/17/2023
2.1.7 951 11/17/2023
2.1.6 1,221 11/17/2023
2.1.5 565 11/17/2023
2.1.4 475 11/16/2023
2.1.3 118 11/16/2023
2.0.52 961 11/15/2023
2.0.51 1,307 11/15/2023
2.0.2 105 11/16/2023
2.0.1 106 11/16/2023
1.0.50 3,383 11/11/2023
1.0.49 94 11/11/2023
1.0.48 79 11/11/2023
1.0.47 1,100 11/9/2023
1.0.46 100 11/9/2023
1.0.45 4,168 11/6/2023
1.0.44 1,894 11/3/2023
1.0.43 1,521 11/2/2023
1.0.42 1,441 11/1/2023
1.0.41 6,120 10/18/2023
1.0.40 2,571 10/17/2023
1.0.39 946 10/16/2023
1.0.38 2,263 10/13/2023
1.0.37 125 10/13/2023
1.0.36 5,060 9/19/2023
1.0.35 1,655 9/18/2023
1.0.34 98 9/18/2023
1.0.33 6,374 8/30/2023
1.0.32 2,283 8/29/2023
1.0.31 3,492 8/24/2023
1.0.30 120 8/24/2023
1.0.29 3,915 8/17/2023
1.0.28 133 8/17/2023
1.0.27 7,259 8/7/2023
1.0.26 135 8/7/2023
1.0.25 7,111 7/10/2023
1.0.24 7,596 7/7/2023
1.0.23 136 7/7/2023
1.0.22 7,907 6/28/2023
1.0.21 38,853 5/24/2023
1.0.20 937 5/24/2023
1.0.19 346 5/23/2023
1.0.18 154 5/31/2023
1.0.17 2,484 5/23/2023
1.0.16 2,725 5/22/2023
1.0.15 5,150 5/17/2023
1.0.14 143 5/17/2023
1.0.13 4,915 4/28/2023
1.0.12 1,902 4/24/2023
1.0.11 823 4/21/2023
1.0.10 3,835 4/12/2023
1.0.9 896 4/11/2023
1.0.8 1,692 4/3/2023
1.0.7 200 4/3/2023
1.0.6 300 4/1/2023
1.0.5 1,873 3/23/2023
1.0.3 479 2/28/2023
1.0.2 387 2/16/2023