AlirezaMahDev.Extensions 0.0.1-alpha7

This is a prerelease version of AlirezaMahDev.Extensions.
dotnet add package AlirezaMahDev.Extensions --version 0.0.1-alpha7
                    
NuGet\Install-Package AlirezaMahDev.Extensions -Version 0.0.1-alpha7
                    
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="AlirezaMahDev.Extensions" Version="0.0.1-alpha7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AlirezaMahDev.Extensions" Version="0.0.1-alpha7" />
                    
Directory.Packages.props
<PackageReference Include="AlirezaMahDev.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AlirezaMahDev.Extensions --version 0.0.1-alpha7
                    
#r "nuget: AlirezaMahDev.Extensions, 0.0.1-alpha7"
                    
#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.
#:package AlirezaMahDev.Extensions@0.0.1-alpha7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AlirezaMahDev.Extensions&version=0.0.1-alpha7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AlirezaMahDev.Extensions&version=0.0.1-alpha7&prerelease
                    
Install as a Cake Tool

AlirezaMahDev.Extensions

Project Description

This project serves as the core implementation of the builder pattern infrastructure for .NET applications. It provides a set of base classes that enable a fluent, type-safe configuration pattern for .NET's dependency injection system, with built-in support for options pattern and hierarchical configuration.

Dependencies

Project Dependencies

  • AlirezaMahDev.Extensions.Abstractions: Defines the core interfaces and contracts for the builder pattern implementation.

NuGet Dependencies

  • Microsoft.Extensions.Hosting: Provides the hosting infrastructure for .NET applications.
  • Microsoft.Extensions.Http: Implements HTTP client factory and related services.
  • Microsoft.Extensions.Http.Polly: Integrates Polly for HTTP resilience patterns.
  • Microsoft.Extensions.Options.ConfigurationExtensions: Enables configuration binding for options pattern.
  • Microsoft.Extensions.Caching.Memory: Provides in-memory caching capabilities.
  • Microsoft.Extensions.ObjectPool: Offers object pooling for performance optimization.
  • Polly.Extensions: Extends the Polly resilience framework with additional functionality.
  • Polly.RateLimiting: Adds rate limiting capabilities to the resilience pipeline.

Key Components

BuilderBase Class Hierarchy

  1. BuilderBase

    • Base class providing access to the service collection
    • Serves as the foundation for all builder implementations
  2. BuilderBase<TOptions>

    • Extends BuilderBase with options configuration support
    • Automatically handles configuration binding using Microsoft.Extensions.Options
    • Supports hierarchical configuration through configuration keys
    • Provides methods for adding and configuring sub-options
  3. BuilderBase<TOptions, TParent, TParentOptions>

    • Enables building hierarchical configuration structures
    • Maintains parent-child relationships between builders
    • Automatically manages configuration key hierarchies

Core Features

  • Fluent API: Enables method chaining for clean, readable configuration code
  • Type Safety: Compile-time checking of configuration options
  • Dependency Injection: Seamless integration with .NET's built-in DI container
  • Configuration Binding: Automatic binding of configuration to strongly-typed options
  • Hierarchical Configuration: Support for nested configuration structures
  • Options Validation: Built-in support for options validation
  • Service Registration: Simplified service registration with common patterns

Usage Example

// Example of creating a hierarchical configuration
services.AddMyService()
    .Configure(options => 
    {
        options.BaseUrl = "https://api.example.com";
    })
    .AddFeatureA()
        .Configure(options => 
        {
            options.FeatureAOption = "Value";
        })
    .AddFeatureB()
        .Configure(options =>
        {
            options.FeatureBOption = 42;
        });

Architecture

The project follows a clean architecture approach where:

  • Core abstractions are defined in the Abstractions project
  • This project provides concrete implementations of those abstractions
  • Dependencies are minimal and focused on the core functionality
  • Extension methods are provided for common scenarios to improve developer experience
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on AlirezaMahDev.Extensions:

Package Downloads
AlirezaMahDev.Extensions.File.Data

Package Description

AlirezaMahDev.Extensions.Node

Package Description

AlirezaMahDev.Extensions.ParameterInstance

Package Description

AlirezaMahDev.Extensions.File

Package Description

AlirezaMahDev.Extensions.DataManager

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-alpha7 409 12/8/2025
0.0.1-alpha 280 12/7/2025