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.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.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.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.56 76 5/17/2024
2.1.55 7,406 4/30/2024
2.1.54 11,432 4/28/2024
2.1.53 74 4/28/2024
2.1.52 476 4/27/2024
2.1.51 78 4/27/2024
2.1.50 18,332 4/12/2024
2.1.49 986 4/12/2024
2.1.48 74 4/12/2024
2.1.47 26,149 3/18/2024
2.1.46 6,481 3/13/2024
2.1.45 1,662 3/13/2024
2.1.44 45,691 2/21/2024
2.1.43 2,055 2/21/2024
2.1.42 79 2/21/2024
2.1.41 16,644 2/16/2024
2.1.40 478 2/16/2024
2.1.39 18,467 2/9/2024
2.1.38 14,643 2/6/2024
2.1.37 79 2/6/2024
2.1.36 49,760 1/15/2024
2.1.35 633 1/15/2024
2.1.34 21,325 1/5/2024
2.1.33 1,974 1/5/2024
2.1.32 10,868 12/27/2023
2.1.31 1,114 12/27/2023
2.1.30 856 12/27/2023
2.1.29 6,114 12/25/2023
2.1.28 1,093 12/25/2023
2.1.27 585 12/25/2023
2.1.26 8,290 12/23/2023
2.1.25 93 12/23/2023
2.1.24 674 12/23/2023
2.1.23 16,447 12/9/2023
2.1.22 1,147 12/9/2023
2.1.21 178 12/9/2023
2.1.20 1,456 12/9/2023
2.1.19 8,609 12/4/2023
2.1.18 673 12/4/2023
2.1.17 4,050 11/26/2023
2.1.16 4,335 11/23/2023
2.1.15 231 11/23/2023
2.1.14 626 11/23/2023
2.1.13 7,291 11/19/2023
2.1.12 101 11/19/2023
2.1.11 853 11/18/2023
2.1.10 2,676 11/18/2023
2.1.9 1,582 11/18/2023
2.1.8 2,854 11/17/2023
2.1.7 950 11/17/2023
2.1.6 1,220 11/17/2023
2.1.5 564 11/17/2023
2.1.4 474 11/16/2023
2.1.3 117 11/16/2023
2.0.52 960 11/15/2023
2.0.51 1,306 11/15/2023
2.0.2 104 11/16/2023
2.0.1 105 11/16/2023
1.0.50 3,380 11/11/2023
1.0.49 87 11/11/2023
1.0.48 78 11/11/2023
1.0.47 1,099 11/9/2023
1.0.46 99 11/9/2023
1.0.45 4,167 11/6/2023
1.0.44 1,893 11/3/2023
1.0.43 1,520 11/2/2023
1.0.42 1,440 11/1/2023
1.0.41 6,119 10/18/2023
1.0.40 2,570 10/17/2023
1.0.39 945 10/16/2023
1.0.38 2,262 10/13/2023
1.0.37 124 10/13/2023
1.0.36 5,059 9/19/2023
1.0.35 1,651 9/18/2023
1.0.34 97 9/18/2023
1.0.33 6,373 8/30/2023
1.0.32 2,282 8/29/2023
1.0.31 3,491 8/24/2023
1.0.30 119 8/24/2023
1.0.29 3,914 8/17/2023
1.0.28 132 8/17/2023
1.0.27 7,256 8/7/2023
1.0.26 134 8/7/2023
1.0.25 7,110 7/10/2023
1.0.24 7,589 7/7/2023
1.0.23 135 7/7/2023
1.0.22 7,900 6/28/2023
1.0.21 38,845 5/24/2023
1.0.20 936 5/24/2023
1.0.19 339 5/23/2023
1.0.18 153 5/31/2023
1.0.17 2,483 5/23/2023
1.0.16 2,724 5/22/2023
1.0.15 5,149 5/17/2023
1.0.14 142 5/17/2023
1.0.13 4,914 4/28/2023
1.0.12 1,901 4/24/2023
1.0.11 822 4/21/2023
1.0.10 3,834 4/12/2023
1.0.9 895 4/11/2023
1.0.8 1,691 4/3/2023
1.0.7 199 4/3/2023
1.0.6 299 4/1/2023
1.0.5 1,865 3/23/2023
1.0.3 478 2/28/2023
1.0.2 386 2/16/2023