Soenneker.Extensions.Enumerable 2.1.50

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 2.1.50
NuGet\Install-Package Soenneker.Extensions.Enumerable -Version 2.1.50
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="2.1.50" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.Extensions.Enumerable --version 2.1.50
#r "nuget: Soenneker.Extensions.Enumerable, 2.1.50"
#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=2.1.50

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

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

alternate text is missing from this package README image Soenneker.Extensions.Enumerable

A collection of helpful enumerable extension methods

Installation

dotnet add 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 net6.0 is compatible.  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 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 is compatible.  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 (10)

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

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

The general purpose utility library leveraging Redis for all of your caching needs

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.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.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)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.54 3,979 4/28/2024
2.1.53 44 4/28/2024
2.1.52 233 4/27/2024
2.1.51 45 4/27/2024
2.1.50 16,077 4/12/2024
2.1.49 982 4/12/2024
2.1.48 71 4/12/2024
2.1.47 26,120 3/18/2024
2.1.46 6,475 3/13/2024
2.1.45 1,659 3/13/2024
2.1.44 45,680 2/21/2024
2.1.43 2,053 2/21/2024
2.1.42 77 2/21/2024
2.1.41 16,635 2/16/2024
2.1.40 476 2/16/2024
2.1.39 18,457 2/9/2024
2.1.38 14,636 2/6/2024
2.1.37 77 2/6/2024
2.1.36 49,751 1/15/2024
2.1.35 631 1/15/2024
2.1.34 21,313 1/5/2024
2.1.33 1,972 1/5/2024
2.1.32 10,862 12/27/2023
2.1.31 1,112 12/27/2023
2.1.30 854 12/27/2023
2.1.29 6,112 12/25/2023
2.1.28 1,091 12/25/2023
2.1.27 583 12/25/2023
2.1.26 8,288 12/23/2023
2.1.25 91 12/23/2023
2.1.24 672 12/23/2023
2.1.23 16,445 12/9/2023
2.1.22 1,145 12/9/2023
2.1.21 176 12/9/2023
2.1.20 1,448 12/9/2023
2.1.19 8,607 12/4/2023
2.1.18 671 12/4/2023
2.1.17 4,047 11/26/2023
2.1.16 4,328 11/23/2023
2.1.15 229 11/23/2023
2.1.14 622 11/23/2023
2.1.13 7,289 11/19/2023
2.1.12 99 11/19/2023
2.1.11 851 11/18/2023
2.1.10 2,671 11/18/2023
2.1.9 1,580 11/18/2023
2.1.8 2,852 11/17/2023
2.1.7 948 11/17/2023
2.1.6 1,218 11/17/2023
2.1.5 562 11/17/2023
2.1.4 472 11/16/2023
2.1.3 115 11/16/2023
2.0.52 957 11/15/2023
2.0.51 1,304 11/15/2023
2.0.2 102 11/16/2023
2.0.1 103 11/16/2023
1.0.50 3,377 11/11/2023
1.0.49 85 11/11/2023
1.0.48 76 11/11/2023
1.0.47 1,097 11/9/2023
1.0.46 97 11/9/2023
1.0.45 4,165 11/6/2023
1.0.44 1,891 11/3/2023
1.0.43 1,516 11/2/2023
1.0.42 1,436 11/1/2023
1.0.41 6,116 10/18/2023
1.0.40 2,568 10/17/2023
1.0.39 943 10/16/2023
1.0.38 2,260 10/13/2023
1.0.37 122 10/13/2023
1.0.36 5,056 9/19/2023
1.0.35 1,647 9/18/2023
1.0.34 95 9/18/2023
1.0.33 6,370 8/30/2023
1.0.32 2,278 8/29/2023
1.0.31 3,489 8/24/2023
1.0.30 117 8/24/2023
1.0.29 3,912 8/17/2023
1.0.28 130 8/17/2023
1.0.27 7,249 8/7/2023
1.0.26 132 8/7/2023
1.0.25 7,102 7/10/2023
1.0.24 7,587 7/7/2023
1.0.23 133 7/7/2023
1.0.22 7,898 6/28/2023
1.0.21 38,842 5/24/2023
1.0.20 934 5/24/2023
1.0.19 337 5/23/2023
1.0.18 151 5/31/2023
1.0.17 2,481 5/23/2023
1.0.16 2,717 5/22/2023
1.0.15 5,147 5/17/2023
1.0.14 140 5/17/2023
1.0.13 4,911 4/28/2023
1.0.12 1,899 4/24/2023
1.0.11 820 4/21/2023
1.0.10 3,832 4/12/2023
1.0.9 893 4/11/2023
1.0.8 1,689 4/3/2023
1.0.7 197 4/3/2023
1.0.6 297 4/1/2023
1.0.5 1,849 3/23/2023
1.0.3 475 2/28/2023
1.0.2 384 2/16/2023