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
<PackageReference Include="AgileCoding.Extentions.Linq" Version="2.0.5" />
paket add AgileCoding.Extentions.Linq --version 2.0.5
#r "nuget: AgileCoding.Extentions.Linq, 2.0.5"
// 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:
TakeTop<TSource>(this List<TSource> source)
: An extension method onList<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.
Single<TSource>(this IEnumerable<TSource> source, string noElementsMessage = "NoElements", string moreThanOneMatchMessage = "MoreThanOneMatch")
: Overloads ofSingle
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.
SingleOrDefault<TSource>(this IEnumerable<TSource> source, string moreThanOneMatchMessage = "MoreThanOneMatch")
: Overloads ofSingleOrDefault
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.
First<TSource, TNoElementsExceptionType>(this IEnumerable<TSource> source, string noElementsMessage = "NoElements")
: Overloads ofFirst
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 | Versions 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. |
-
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.
Nuget Package Start