AgileCoding.Extentions.Linq 2.0.5

dotnet add package AgileCoding.Extentions.Linq --version 2.0.5                
NuGet\Install-Package AgileCoding.Extentions.Linq -Version 2.0.5                
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="AgileCoding.Extentions.Linq" Version="2.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AgileCoding.Extentions.Linq --version 2.0.5                
#r "nuget: AgileCoding.Extentions.Linq, 2.0.5"                
#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 AgileCoding.Extentions.Linq as a Cake Addin
#addin nuget:?package=AgileCoding.Extentions.Linq&version=2.0.5

// Install AgileCoding.Extentions.Linq as a Cake Tool
#tool nuget:?package=AgileCoding.Extentions.Linq&version=2.0.5                

AgileCoding.Extentions.Linq

Description

This is a .NET 6.0 NuGet package that provides various useful extensions to LINQ. The extensions are added in the AgileCoding.Extentions.Linq namespace and offer powerful tools to manipulate data structures.

Key Features

Here are some key methods provided by this library:

  1. TakeTop<TSource>(this List<TSource> source): An extension method on List<TSource> to take and remove the top element from the list.
List<int> numbers = new List<int> { 1, 2, 3, 4, 5 };
int top = numbers.TakeTop();  // Returns 1 and removes it from the list.
  1. Single<TSource>(this IEnumerable<TSource> source, string noElementsMessage = "NoElements", string moreThanOneMatchMessage = "MoreThanOneMatch"): Overloads of Single method with additional parameters for providing custom error messages.
List<int> numbers = new List<int> { 1 };
int single = numbers.Single("No elements found", "More than one match found");  // Returns 1 if the list has exactly one element, otherwise throws exception with specified error message.
  1. SingleOrDefault<TSource>(this IEnumerable<TSource> source, string moreThanOneMatchMessage = "MoreThanOneMatch"): Overloads of SingleOrDefault method with additional parameters for providing custom error messages.
List<int> numbers = new List<int> { 1 };
int singleOrDefault = numbers.SingleOrDefault("More than one match found");  // Returns 1 if the list has exactly one element, null if no elements, otherwise throws exception with specified error message.
  1. First<TSource, TNoElementsExceptionType>(this IEnumerable<TSource> source, string noElementsMessage = "NoElements"): Overloads of First method with additional parameters for providing custom error messages.
List<int> numbers = new List<int> { 1, 2, 3, 4, 5 };
int first = numbers.First<InvalidOperationException>("No elements found");  // Returns 1 if the list has at least one element, otherwise throws exception with specified error message.

Installation

To install this package, you can use the .NET CLI and type:

dotnet add package AgileCoding.Extentions.Linq --version 2.0.5

Usage

First, include the namespace in your file:

using AgileCoding.Extentions.Linq;

Then, use the methods as per your requirements with the examples provided above.

Documentation

For more detailed usage instructions, please visit the project's Wiki page.

Contributing

This project is open-source and hosted on GitHub. Contributions are welcome. To contribute, please visit the repository.

License

This project is licensed under the terms mentioned in the LICENSE file at the root of the repository. Please make sure you comply with the terms before using it in your projects.

Release Notes

The current version of the package is 2.0.5. For detailed release notes, please check out the repository.

Contact

The package is maintained by Ernie Gunning. If you have any questions or suggestions, please feel free to reach out.

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 was computed.  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.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AgileCoding.Extentions.Linq:

Package Downloads
AgileCoding.Library.Loggers

Logger implementations based one the AgileCoding ILogger interface

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.5 234 8/2/2023
1.0.0.2 404 6/28/2021
1.0.0.1 405 5/24/2021

Nuget Package Start