aemarcoToolboxAppOptions 8.4.12

dotnet add package aemarcoToolboxAppOptions --version 8.4.12
                    
NuGet\Install-Package aemarcoToolboxAppOptions -Version 8.4.12
                    
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="aemarcoToolboxAppOptions" Version="8.4.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="aemarcoToolboxAppOptions" Version="8.4.12" />
                    
Directory.Packages.props
<PackageReference Include="aemarcoToolboxAppOptions" />
                    
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 aemarcoToolboxAppOptions --version 8.4.12
                    
#r "nuget: aemarcoToolboxAppOptions, 8.4.12"
                    
#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 aemarcoToolboxAppOptions@8.4.12
                    
#: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=aemarcoToolboxAppOptions&version=8.4.12
                    
Install as a Cake Addin
#tool nuget:?package=aemarcoToolboxAppOptions&version=8.4.12
                    
Install as a Cake Tool

aemarcoToolboxAppOptions

<a href=https://www.nuget.org/packages/aemarcoToolboxAppOptions><img src="https://buildstats.info/nuget/aemarcoToolboxAppOptions"></a><br/>

Overview

This package provides a opinionated approach to the Options pattern described in the Microsoft docs. With minimal setup, all the Option classes will be registered in the IOC container and mapped to the IConfiguration source.

  • Automatic mapping of sections to classes (convention driven, but can be adjusted)
  • Beside registering the interfaces from Microsoft, registers the class itself as well (singleton)
  • Registers also interfaces which you put on the settings class
  • Allows text transformations between IConfiguration and the settings class
  • Option to use fluent validation on settings
  • Option to validate settings during startup (on by default, opt-out in options)

Get Started

During startup of the app

{
  services.AddConfigOptionsUtils(config);
}

Create your class representing your options

{
  public class MySettings : ISettingsBase
  {
    public string? Text { get; set; }
    public bool Enable { get; set; }
  }
}

In appsetting.json (or other IConfiguration source)

{
    "MySettings": {
        
        "Text": "SomeText",
        "Enable": true
    }
}

StringTransformation

String transformations will be executed in the order defined in the setup process. You could define your own, but PlaceholderTransformation is built in already.

{
    services.AddConfigOptionsUtils(
        config,
        x => x
            .AddStringTransformation(new PlaceholderTransformation());
}

PlaceholderTransformation does resolve placeholders {{{...}}} through the entire IConfguration by Key. That maybe usefull when piecing together file or url path.

{
    "Message": "Hello world!",
    "MySettings": {
        
        "Text": "The message is {{{Message}}}",
        "Enable": true
    }
}

Fluent Validation

Just define your Validators in the assemblies where setting classes are defined. The tool will register them, and use them if present. By default, Validation takes place at startup.

{
    services.AddConfigOptionsUtils(
        config,
        x => x
            .EnableValidationOnStartup(false); //on by default
}

Setting classes in multiple assemblies

The tool relies on assembly scanning during the setup. If your option classes are in other assemblies, you may pass one of the types as assembly marker, and/or use the assemblies itself.

{
    services.AddConfigOptionsUtils(
        config,
        x => x
            .AddAssemblyMarker(typeof(MySettings))
            // and/or
            .AddAssemblies(someAssemblies));
}

Mapping Path

By default, the class name is exactly matched to the root level of the configuration. You may define your own path in the settings class

{
  [SettingsPath("Settings")]
  public class MySettings : ISettingsBase
  {
    public string? Text { get; set; }
    public bool Enable { get; set; }
  }
}

would map to

{
    "Settings": {
        
        "Text": "SomeText",
        "Enable": true
    }
}

You could even do it nested, just use the colon seperated path as you would with GetSection().

{
  [SettingsPath("Settings:Nested")]
  public class MySettings : ISettingsBase
  {
    public string? Text { get; set; }
    public bool Enable { get; set; }
  }
}

would map to

{
    "Settings": {
        "Nested":{
            "Text": "SomeText",
            "Enable": true
        }
    }
}
Product 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.  net9.0 was computed.  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.  net10.0 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.4.12 118 8/30/2025
8.4.11 215 8/6/2025
8.4.10 52 8/2/2025
8.4.9 38 8/1/2025
8.4.6 96 7/27/2025
8.4.5 127 6/20/2025
8.4.4 105 5/3/2025
8.4.3 103 4/26/2025
8.4.2 108 4/25/2025
8.4.1 177 4/20/2025
8.3.2 184 4/20/2025
8.2.11 191 4/20/2025
8.2.10 215 4/13/2025
8.2.9 186 4/6/2025
8.2.8 174 3/30/2025
8.2.7 296 3/23/2025
8.2.6 162 3/16/2025
8.2.5 141 3/2/2025
8.2.4 143 1/26/2025
8.2.3 130 1/9/2025
8.2.2 213 1/9/2025
8.1.4 154 1/1/2025
8.1.3 147 12/31/2024
8.1.2 133 12/26/2024
8.0.8 128 12/23/2024
8.0.7 133 12/23/2024
8.0.6 127 12/22/2024
8.0.5 126 12/21/2024
8.0.4 126 11/17/2024
8.0.3 167 11/17/2024
5.0.21 135 11/16/2024
5.0.20 148 10/20/2024
5.0.19 138 10/19/2024
5.0.18 163 10/19/2024
5.0.17 154 10/13/2024
5.0.16 140 10/12/2024
5.0.6 127 10/6/2024
5.0.5 141 10/2/2024
5.0.4 131 10/1/2024
5.0.3 137 9/22/2024
5.0.2 232 9/16/2024
4.0.9 152 9/15/2024
4.0.8 141 9/8/2024
4.0.7 127 9/8/2024
4.0.6 127 9/8/2024
4.0.5 118 9/8/2024
4.0.2 152 9/8/2024
3.1.27 143 9/8/2024
3.1.26 149 9/7/2024
3.1.25 163 9/7/2024
3.1.24 146 9/7/2024
3.1.23 141 9/1/2024
3.1.22 143 9/1/2024
3.1.21 162 6/16/2024
3.1.20 135 5/31/2024
3.1.19 127 5/20/2024
3.1.18 139 5/10/2024
3.1.17 164 4/12/2024
3.1.16 165 4/4/2024
3.1.15 173 3/22/2024
3.1.11 164 3/19/2024
3.1.10 175 2/16/2024
3.1.7 189 2/11/2024
3.1.6 175 2/11/2024
3.1.5 167 2/11/2024
3.1.4 156 2/11/2024
3.0.18 222 1/29/2024
3.0.17 146 1/29/2024
3.0.16 148 1/27/2024
3.0.15 146 1/27/2024
3.0.8 155 1/27/2024
3.0.7 208 1/13/2024
2.0.18 228 1/4/2024
2.0.17 230 1/1/2024
2.0.16 229 12/27/2023
2.0.15 212 12/26/2023
2.0.14 222 12/26/2023
2.0.13 194 12/25/2023
2.0.11 184 12/23/2023
2.0.10 229 12/16/2023
2.0.9 206 12/15/2023
2.0.8 227 12/14/2023
2.0.7 227 12/13/2023
2.0.5 229 12/11/2023
2.0.4 224 12/11/2023
2.0.2 244 12/10/2023
1.9.2 226 12/10/2023
1.8.4 238 12/10/2023
1.8.3 256 12/9/2023
1.8.2 232 12/9/2023
1.1.28 254 11/27/2023
1.1.27 222 11/26/2023
1.1.26 239 11/18/2023
1.1.25 226 11/17/2023
1.1.24 280 10/30/2023
1.1.23 239 10/29/2023
1.1.22 248 10/22/2023
1.1.21 260 10/17/2023
1.1.20 282 9/16/2023
1.1.19 363 8/27/2023
1.1.18 288 7/31/2023
1.1.17 328 7/16/2023
1.1.16 309 7/9/2023
1.1.15 328 7/8/2023
1.1.14 338 7/5/2023
1.1.13 309 6/29/2023
1.1.12 326 5/1/2023
1.1.11 500 3/5/2023
1.1.10 446 3/3/2023
1.1.9 473 2/28/2023
1.1.7 500 2/26/2023
1.1.6 461 2/26/2023
1.1.5 345 2/26/2023
1.1.3 324 2/25/2023