Soenneker.Extensions.Enumerable 2.1.160

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

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

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 (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.161 0 9/26/2024
2.1.160 693 9/26/2024
2.1.159 2,649 9/26/2024
2.1.158 3,725 9/23/2024
2.1.157 2,469 9/23/2024
2.1.156 1,536 9/23/2024
2.1.155 1,553 9/23/2024
2.1.154 5,225 9/23/2024
2.1.153 601 9/23/2024
2.1.152 739 9/23/2024
2.1.151 57 9/23/2024
2.1.150 2,040 9/23/2024
2.1.149 10,079 9/17/2024
2.1.148 63 9/17/2024
2.1.147 361 9/17/2024
2.1.146 4,114 9/17/2024
2.1.145 3,676 9/17/2024
2.1.144 4,735 9/17/2024
2.1.143 74 9/17/2024
2.1.142 444 9/17/2024
2.1.141 1,071 9/17/2024
2.1.140 10,840 9/16/2024
2.1.139 6,601 9/12/2024
2.1.138 4,570 9/11/2024
2.1.137 2,732 9/11/2024
2.1.136 5,334 9/11/2024
2.1.135 4,414 9/11/2024
2.1.134 9,987 9/10/2024
2.1.133 2,053 9/10/2024
2.1.132 3,325 9/9/2024
2.1.131 3,705 9/9/2024
2.1.130 2,451 9/9/2024
2.1.129 1,123 9/9/2024
2.1.128 65 9/9/2024
2.1.127 73 9/9/2024
2.1.126 61 9/9/2024
2.1.125 15,099 9/6/2024
2.1.124 5,825 9/6/2024
2.1.123 2,992 9/5/2024
2.1.122 1,829 9/5/2024
2.1.121 3,624 9/5/2024
2.1.120 1,958 9/5/2024
2.1.119 62 9/5/2024
2.1.118 1,406 9/5/2024
2.1.117 5,351 9/5/2024
2.1.116 1,264 9/4/2024
2.1.115 10,809 9/3/2024
2.1.114 1,065 9/3/2024
2.1.113 4,440 9/3/2024
2.1.112 8,623 8/29/2024
2.1.111 5,973 8/26/2024
2.1.110 6,008 8/21/2024
2.1.109 3,370 8/21/2024
2.1.108 357 8/20/2024
2.1.107 4,199 8/20/2024
2.1.106 79 8/20/2024
2.1.105 4,233 8/20/2024
2.1.104 2,550 8/20/2024
2.1.103 8,060 8/15/2024
2.1.102 7,275 8/13/2024
2.1.101 6,920 8/6/2024
2.1.100 8,083 8/1/2024
2.1.99 491 8/1/2024
2.1.98 7,549 7/25/2024
2.1.97 883 7/25/2024
2.1.96 819 7/25/2024
2.1.95 547 7/24/2024
2.1.94 185 7/24/2024
2.1.93 7,758 7/20/2024
2.1.92 7,318 7/14/2024
2.1.91 1,973 7/14/2024
2.1.90 5,997 7/10/2024
2.1.89 187 7/10/2024
2.1.88 1,833 7/10/2024
2.1.87 1,840 7/10/2024
2.1.86 170 7/10/2024
2.1.85 173 7/10/2024
2.1.83 1,904 7/10/2024
2.1.82 2,938 7/9/2024
2.1.80 742 7/9/2024
2.1.79 1,209 7/9/2024
2.1.78 6,963 7/9/2024
2.1.77 2,683 7/9/2024
2.1.76 4,519 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,261 7/8/2024
2.1.71 78 7/8/2024
2.1.70 6,077 7/8/2024
2.1.69 1,909 7/7/2024
2.1.68 2,297 7/7/2024
2.1.67 584 7/7/2024
2.1.66 1,161 7/7/2024
2.1.65 2,658 7/7/2024
2.1.64 2,351 7/7/2024
2.1.63 92 7/7/2024
2.1.62 3,238 7/5/2024
2.1.61 64,331 5/25/2024
2.1.60 92 5/25/2024
2.1.59 467 5/25/2024
2.1.58 12,322 5/22/2024
2.1.57 97 5/22/2024
2.1.56 10,176 5/17/2024
2.1.55 13,984 4/30/2024
2.1.54 13,855 4/28/2024
2.1.53 93 4/28/2024
2.1.52 614 4/27/2024
2.1.51 92 4/27/2024
2.1.50 22,042 4/12/2024
2.1.49 1,226 4/12/2024
2.1.48 101 4/12/2024
2.1.47 31,975 3/18/2024
2.1.46 7,765 3/13/2024
2.1.45 1,982 3/13/2024
2.1.44 54,429 2/21/2024
2.1.43 2,500 2/21/2024
2.1.42 100 2/21/2024
2.1.41 19,573 2/16/2024
2.1.40 577 2/16/2024
2.1.39 21,469 2/9/2024
2.1.38 16,996 2/6/2024
2.1.37 101 2/6/2024
2.1.36 57,252 1/15/2024
2.1.35 758 1/15/2024
2.1.34 24,136 1/5/2024
2.1.33 2,208 1/5/2024
2.1.32 12,295 12/27/2023
2.1.31 1,244 12/27/2023
2.1.30 1,005 12/27/2023
2.1.29 7,219 12/25/2023
2.1.28 1,243 12/25/2023
2.1.27 630 12/25/2023
2.1.26 9,755 12/23/2023
2.1.25 117 12/23/2023
2.1.24 753 12/23/2023
2.1.23 19,166 12/9/2023
2.1.22 1,254 12/9/2023
2.1.21 215 12/9/2023
2.1.20 1,776 12/9/2023
2.1.19 10,097 12/4/2023
2.1.18 738 12/4/2023
2.1.17 5,023 11/26/2023
2.1.16 5,018 11/23/2023
2.1.15 312 11/23/2023
2.1.14 824 11/23/2023
2.1.13 8,653 11/19/2023
2.1.12 125 11/19/2023
2.1.11 1,011 11/18/2023
2.1.10 3,135 11/18/2023
2.1.9 1,780 11/18/2023
2.1.8 3,390 11/17/2023
2.1.7 1,016 11/17/2023
2.1.6 1,490 11/17/2023
2.1.5 747 11/17/2023
2.1.4 548 11/16/2023
2.1.3 147 11/16/2023
2.0.52 1,163 11/15/2023
2.0.51 1,959 11/15/2023
2.0.2 122 11/16/2023
2.0.1 129 11/16/2023
1.0.50 3,821 11/11/2023
1.0.49 112 11/11/2023
1.0.48 97 11/11/2023
1.0.47 1,243 11/9/2023
1.0.46 118 11/9/2023
1.0.45 4,825 11/6/2023
1.0.44 2,091 11/3/2023
1.0.43 1,703 11/2/2023
1.0.42 1,730 11/1/2023
1.0.41 6,947 10/18/2023
1.0.40 2,813 10/17/2023
1.0.39 1,133 10/16/2023
1.0.38 2,500 10/13/2023
1.0.37 143 10/13/2023
1.0.36 5,704 9/19/2023
1.0.35 1,876 9/18/2023
1.0.34 120 9/18/2023
1.0.33 7,222 8/30/2023
1.0.32 2,527 8/29/2023
1.0.31 3,788 8/24/2023
1.0.30 135 8/24/2023
1.0.29 4,128 8/17/2023
1.0.28 147 8/17/2023
1.0.27 7,636 8/7/2023
1.0.26 154 8/7/2023
1.0.25 7,414 7/10/2023
1.0.24 9,467 7/7/2023
1.0.23 153 7/7/2023
1.0.22 8,797 6/28/2023
1.0.21 42,033 5/24/2023
1.0.20 1,053 5/24/2023
1.0.19 363 5/23/2023
1.0.18 174 5/31/2023
1.0.17 2,616 5/23/2023
1.0.16 2,825 5/22/2023
1.0.15 5,563 5/17/2023
1.0.14 158 5/17/2023
1.0.13 5,240 4/28/2023
1.0.12 2,052 4/24/2023
1.0.11 888 4/21/2023
1.0.10 4,137 4/12/2023
1.0.9 985 4/11/2023
1.0.8 1,866 4/3/2023
1.0.7 218 4/3/2023
1.0.6 339 4/1/2023
1.0.5 1,934 3/23/2023
1.0.3 516 2/28/2023
1.0.2 406 2/16/2023