Eliassen.Extensions
0.1.81-dev-gh-pipline.3
See the version list below for details.
dotnet add package Eliassen.Extensions --version 0.1.81-dev-gh-pipline.3
NuGet\Install-Package Eliassen.Extensions -Version 0.1.81-dev-gh-pipline.3
<PackageReference Include="Eliassen.Extensions" Version="0.1.81-dev-gh-pipline.3" />
paket add Eliassen.Extensions --version 0.1.81-dev-gh-pipline.3
#r "nuget: Eliassen.Extensions, 0.1.81-dev-gh-pipline.3"
// Install Eliassen.Extensions as a Cake Addin #addin nuget:?package=Eliassen.Extensions&version=0.1.81-dev-gh-pipline.3&prerelease // Install Eliassen.Extensions as a Cake Tool #tool nuget:?package=Eliassen.Extensions&version=0.1.81-dev-gh-pipline.3&prerelease
Eliassen.Extensions
Overview
The Eliassen.Extensions namespace provides a collection of extension methods and utility classes for common tasks such as accessing values, configuration, file operations, stream manipulation, reflection, and string manipulation.
Key Classes and Extensions
- Accessor<T>: Represents an accessor for a value of type T, providing a property to get or set the associated value.
- CommandLine: Provides a builder pattern for command parameter arguments, with methods for adding and building configurable parameters.
- ConfigurationBuilderExtensions: Extension methods for adding in-memory collections to the IConfigurationBuilder, allowing the addition of initial data.
- FileTools: Provides methods for working with files, including asynchronous splitting of files into chunks.
- StreamExtensions: Provides methods for working with streams, such as creating an in-memory copy of a stream and splitting a stream into chunks.
- StreamJsonDeserializeExtensions: Extension methods for deserializing JSON streams using System.Text.Json.
- StreamXmlDeserializeExtensions: Extension methods for deserializing XML streams using System.Xml.
- AsyncEnumerableExtensions: Extensions to add async support to existing IEnumerable<T>, including methods for converting async enumerable sequences to lists and sets.
- DictionaryExtensions: Reusable extensions for generic dictionaries, including methods for getting values with a custom comparer and changing the dictionary comparer.
- EnumerableExtensions: Provides extension methods for asynchronous enumerables, such as converting async enumerable sequences to sets.
- ReflectionExtensions: Extensions for reflection and common patterns, including methods for getting method parameters, attributes, and static or instance methods.
- ResourceExtensions: Extension methods for working with embedded resources, including methods for getting resource streams and content as strings.
- ServiceCollectionExtensions: Suggested IOC configurations, including methods for registering accessor types and getting singleton instances from the IOC container.
- StringTools: Provides utility methods for string manipulation, such as splitting strings into lines and concatenating lines with newline separators.
Getting Started
The Eliassen.Extensions namespace offers a wide range of utility classes and extension methods to streamline common development tasks. Simply include the namespace in your project and start using the provided classes and extensions in your code.
Example Usage
// Example of using StreamExtensions to split a file into chunks
var filename = "example.txt";
var chunkLength = 1024;
var overlap = 128;
await using var fileStream = File.OpenRead(filename);
await foreach (var chunk in fileStream.SplitStreamAsync(chunkLength, overlap))
{
// Process each chunk asynchronously
}
// Example of using ReflectionExtensions to get method parameters
var methodInfo = typeof(MyClass).GetMethod("MyMethod");
var parameters = methodInfo.GetParametersTypes();
// Example of using ServiceCollectionExtensions to register accessor types
services.AddAccessor<MyClass>();
// Example of using StringTools to split a string into lines
var input = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
var lines = input.SplitBy(20); // Split into lines of max 20 characters
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- Eliassen.System.Abstractions (>= 0.1.81-dev-gh-pipline.3)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
NuGet packages (13)
Showing the top 5 NuGet packages that depend on Eliassen.Extensions:
Package | Downloads |
---|---|
Eliassen.System.Linq
Package Description |
|
Eliassen.System
Package Description |
|
Eliassen.Search
Package Description |
|
Eliassen.AspNetCore.Mvc
Package Description |
|
Eliassen.Communications
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.