Infinity.Toolkit
1.0.0
dotnet add package Infinity.Toolkit --version 1.0.0
NuGet\Install-Package Infinity.Toolkit -Version 1.0.0
<PackageReference Include="Infinity.Toolkit" Version="1.0.0" />
paket add Infinity.Toolkit --version 1.0.0
#r "nuget: Infinity.Toolkit, 1.0.0"
// Install Infinity.Toolkit as a Cake Addin #addin nuget:?package=Infinity.Toolkit&version=1.0.0 // Install Infinity.Toolkit as a Cake Tool #tool nuget:?package=Infinity.Toolkit&version=1.0.0
Infinity.Toolkit
Infinity.Toolkit is a .NET 9.0 library that provides a set of tools and utilities for various purposes. This document provides an overview of the public methods available in the library.
Installation
To install Infinity.Toolkit, add the following package reference to your project file:
<PackageReference Include="Infinity.Toolkit" Version="1.0.0" />
Usage
Public Methods
ValueStopwatch
- IsActive: Indicates whether the stopwatch is active.
- StartNew: Starts a new instance of the
ValueStopwatch
. - GetElapsedTime: Gets the total elapsed time measured by the current instance, in milliseconds.
RequiredIfAttribute
- FormatErrorMessage: Formats the error message to display if validation fails.
- IsValid: Validates the specified value with respect to the current validation attribute.
EnvironmentHelper
- IsRunningInAzureAppService: Checks if the application is running in Azure App Service.
- IsRunningInContainer: Checks if the application is running in a container.
AuthenticationBuilderExtensions
- AddMultipleBearerPolicySchemes: Adds a policy scheme that can dynamically select the authentication scheme based on the token issuer.
IEnumerableExtensions
AllEqual:
- Definition:
public static bool AllEqual<T>(this IEnumerable<T> values) where T : class
- Description: Check if all items are equal.
- Parameters:
values
: Collection to iterate.
- Returns:
bool
indicating if all items are equal.
- Definition:
AllEqual:
- Definition:
public static bool AllEqual<T>(this IEnumerable<T> values, T value) where T : class
- Description: Check if all items are equal to a specified value.
- Parameters:
values
: Collection to iterate.value
: The value to check if all are equal to.
- Returns:
bool
indicating if all items are equal to the specified value.
- Definition:
ForEach:
- Definition:
public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action)
- Description: Apply an action to each element.
- Parameters:
enumerable
: Collection to iterate.action
: Action to apply on each element.
- Definition:
NullToEmpty:
- Definition:
public static IEnumerable<T> NullToEmpty<T>(this IEnumerable<T>? input)
- Description: Converts an expected IEnumerable set to null to an empty IEnumerable.
- Parameters:
input
: IEnumerable producing the generic type T, or null.
- Returns: The original IEnumerable or an empty IEnumerable if the original IEnumerable is set to null.
- Definition:
ToIAsyncEnumerable:
- Definition:
public static async IAsyncEnumerable<T> ToIAsyncEnumerable<T>(this Task<IEnumerable<T>> input)
- Description: Converts a Task{IEnumerable{T}} to an IAsyncEnumerable{T}.
- Parameters:
input
: A Task returning an IEnumerable{T}.
- Returns: An IAsyncEnumerable{T}.
- Definition:
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net9.0
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 9.0.1)
- Microsoft.Extensions.DependencyModel (>= 9.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.1)
- Scrutor (>= 6.0.1)
- System.Memory.Data (>= 9.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Infinity.Toolkit:
Package | Downloads |
---|---|
Infinity.Toolkit.Messaging
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 82 | 1/30/2025 |
1.0.0-alpha-1 | 74 | 11/15/2024 |