Soenneker.Extensions.Enumerable 1.0.12

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.12                
NuGet\Install-Package Soenneker.Extensions.Enumerable -Version 1.0.12                
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.12" />                
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.12                
#r "nuget: Soenneker.Extensions.Enumerable, 1.0.12"                
#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.12

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

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

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

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

Soenneker.Utils.String

A utility library for useful String operations

Soenneker.Utils.Process

A utility library implementing useful process operations

Soenneker.Swashbuckle.Authentication

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

Soenneker.Extensions.Enumerable.String

A collection of helpful enumerable string extension methods

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.172 540 10/1/2024
2.1.171 837 10/1/2024
2.1.170 1,206 10/1/2024
2.1.169 5,068 9/29/2024
2.1.168 1,832 9/29/2024
2.1.167 1,386 9/29/2024
2.1.166 7,547 9/27/2024
2.1.165 4,478 9/27/2024
2.1.164 60 9/27/2024
2.1.163 228 9/27/2024
2.1.162 63 9/27/2024
2.1.161 6,828 9/26/2024
2.1.160 6,412 9/26/2024
2.1.159 6,025 9/26/2024
2.1.158 6,442 9/23/2024
2.1.157 3,228 9/23/2024
2.1.156 1,891 9/23/2024
2.1.155 1,990 9/23/2024
2.1.154 6,463 9/23/2024
2.1.153 696 9/23/2024
2.1.152 849 9/23/2024
2.1.151 58 9/23/2024
2.1.150 2,324 9/23/2024
2.1.149 11,544 9/17/2024
2.1.148 64 9/17/2024
2.1.147 380 9/17/2024
2.1.146 4,722 9/17/2024
2.1.145 4,133 9/17/2024
2.1.144 5,424 9/17/2024
2.1.143 75 9/17/2024
2.1.142 493 9/17/2024
2.1.141 1,182 9/17/2024
2.1.140 12,486 9/16/2024
2.1.139 7,354 9/12/2024
2.1.138 5,081 9/11/2024
2.1.137 3,049 9/11/2024
2.1.136 5,940 9/11/2024
2.1.135 4,859 9/11/2024
2.1.134 11,091 9/10/2024
2.1.133 2,311 9/10/2024
2.1.132 3,696 9/9/2024
2.1.131 4,067 9/9/2024
2.1.130 2,567 9/9/2024
2.1.129 1,209 9/9/2024
2.1.128 66 9/9/2024
2.1.127 74 9/9/2024
2.1.126 62 9/9/2024
2.1.125 16,734 9/6/2024
2.1.124 6,478 9/6/2024
2.1.123 3,339 9/5/2024
2.1.122 2,006 9/5/2024
2.1.121 4,081 9/5/2024
2.1.120 2,183 9/5/2024
2.1.119 63 9/5/2024
2.1.118 1,600 9/5/2024
2.1.117 5,864 9/5/2024
2.1.116 1,377 9/4/2024
2.1.115 11,998 9/3/2024
2.1.114 1,156 9/3/2024
2.1.113 4,893 9/3/2024
2.1.112 9,507 8/29/2024
2.1.111 6,681 8/26/2024
2.1.110 6,674 8/21/2024
2.1.109 3,791 8/21/2024
2.1.108 408 8/20/2024
2.1.107 4,700 8/20/2024
2.1.106 80 8/20/2024
2.1.105 4,761 8/20/2024
2.1.104 2,885 8/20/2024
2.1.103 9,021 8/15/2024
2.1.102 8,157 8/13/2024
2.1.101 7,738 8/6/2024
2.1.100 9,140 8/1/2024
2.1.99 537 8/1/2024
2.1.98 8,636 7/25/2024
2.1.97 1,038 7/25/2024
2.1.96 957 7/25/2024
2.1.95 617 7/24/2024
2.1.94 193 7/24/2024
2.1.93 8,862 7/20/2024
2.1.92 8,161 7/14/2024
2.1.91 2,205 7/14/2024
2.1.90 6,768 7/10/2024
2.1.89 208 7/10/2024
2.1.88 2,137 7/10/2024
2.1.87 2,021 7/10/2024
2.1.86 193 7/10/2024
2.1.85 185 7/10/2024
2.1.83 2,096 7/10/2024
2.1.82 3,197 7/9/2024
2.1.80 815 7/9/2024
2.1.79 1,236 7/9/2024
2.1.78 7,669 7/9/2024
2.1.77 3,022 7/9/2024
2.1.76 5,244 7/9/2024
2.1.75 93 7/9/2024
2.1.74 111 7/8/2024
2.1.73 91 7/8/2024
2.1.72 2,490 7/8/2024
2.1.71 78 7/8/2024
2.1.70 6,886 7/8/2024
2.1.69 2,252 7/7/2024
2.1.68 2,554 7/7/2024
2.1.67 655 7/7/2024
2.1.66 1,291 7/7/2024
2.1.65 3,008 7/7/2024
2.1.64 2,674 7/7/2024
2.1.63 92 7/7/2024
2.1.62 3,581 7/5/2024
2.1.61 72,496 5/25/2024
2.1.60 92 5/25/2024
2.1.59 505 5/25/2024
2.1.58 13,882 5/22/2024
2.1.57 97 5/22/2024
2.1.56 11,365 5/17/2024
2.1.55 15,826 4/30/2024
2.1.54 15,655 4/28/2024
2.1.53 93 4/28/2024
2.1.52 654 4/27/2024
2.1.51 92 4/27/2024
2.1.50 24,856 4/12/2024
2.1.49 1,330 4/12/2024
2.1.48 101 4/12/2024
2.1.47 36,202 3/18/2024
2.1.46 8,645 3/13/2024
2.1.45 2,225 3/13/2024
2.1.44 60,634 2/21/2024
2.1.43 2,705 2/21/2024
2.1.42 100 2/21/2024
2.1.41 21,584 2/16/2024
2.1.40 608 2/16/2024
2.1.39 23,646 2/9/2024
2.1.38 18,707 2/6/2024
2.1.37 101 2/6/2024
2.1.36 62,316 1/15/2024
2.1.35 813 1/15/2024
2.1.34 25,927 1/5/2024
2.1.33 2,411 1/5/2024
2.1.32 13,185 12/27/2023
2.1.31 1,305 12/27/2023
2.1.30 1,067 12/27/2023
2.1.29 7,765 12/25/2023
2.1.28 1,351 12/25/2023
2.1.27 659 12/25/2023
2.1.26 10,425 12/23/2023
2.1.25 118 12/23/2023
2.1.24 794 12/23/2023
2.1.23 20,471 12/9/2023
2.1.22 1,326 12/9/2023
2.1.21 238 12/9/2023
2.1.20 1,875 12/9/2023
2.1.19 10,724 12/4/2023
2.1.18 812 12/4/2023
2.1.17 5,379 11/26/2023
2.1.16 5,342 11/23/2023
2.1.15 318 11/23/2023
2.1.14 931 11/23/2023
2.1.13 9,319 11/19/2023
2.1.12 126 11/19/2023
2.1.11 1,182 11/18/2023
2.1.10 3,365 11/18/2023
2.1.9 1,920 11/18/2023
2.1.8 3,625 11/17/2023
2.1.7 1,062 11/17/2023
2.1.6 1,672 11/17/2023
2.1.5 853 11/17/2023
2.1.4 617 11/16/2023
2.1.3 172 11/16/2023
2.0.52 1,228 11/15/2023
2.0.51 2,119 11/15/2023
2.0.2 123 11/16/2023
2.0.1 130 11/16/2023
1.0.50 4,089 11/11/2023
1.0.49 113 11/11/2023
1.0.48 98 11/11/2023
1.0.47 1,327 11/9/2023
1.0.46 119 11/9/2023
1.0.45 5,163 11/6/2023
1.0.44 2,222 11/3/2023
1.0.43 1,800 11/2/2023
1.0.42 1,862 11/1/2023
1.0.41 7,439 10/18/2023
1.0.40 2,979 10/17/2023
1.0.39 1,229 10/16/2023
1.0.38 2,648 10/13/2023
1.0.37 144 10/13/2023
1.0.36 6,117 9/19/2023
1.0.35 2,026 9/18/2023
1.0.34 121 9/18/2023
1.0.33 7,649 8/30/2023
1.0.32 2,657 8/29/2023
1.0.31 4,122 8/24/2023
1.0.30 136 8/24/2023
1.0.29 4,300 8/17/2023
1.0.28 148 8/17/2023
1.0.27 7,985 8/7/2023
1.0.26 157 8/7/2023
1.0.25 7,952 7/10/2023
1.0.24 10,270 7/7/2023
1.0.23 154 7/7/2023
1.0.22 9,263 6/28/2023
1.0.21 44,142 5/24/2023
1.0.20 1,103 5/24/2023
1.0.19 394 5/23/2023
1.0.18 175 5/31/2023
1.0.17 2,712 5/23/2023
1.0.16 2,890 5/22/2023
1.0.15 5,904 5/17/2023
1.0.14 159 5/17/2023
1.0.13 5,542 4/28/2023
1.0.12 2,182 4/24/2023
1.0.11 949 4/21/2023
1.0.10 4,449 4/12/2023
1.0.9 1,055 4/11/2023
1.0.8 2,014 4/3/2023
1.0.7 219 4/3/2023
1.0.6 352 4/1/2023
1.0.5 1,995 3/23/2023
1.0.3 530 2/28/2023
1.0.2 432 2/16/2023