RES.Configuration 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RES.Configuration --version 1.0.0
NuGet\Install-Package RES.Configuration -Version 1.0.0
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="RES.Configuration" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RES.Configuration --version 1.0.0
#r "nuget: RES.Configuration, 1.0.0"
#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.
// Install RES.Configuration as a Cake Addin
#addin nuget:?package=RES.Configuration&version=1.0.0

// Install RES.Configuration as a Cake Tool
#tool nuget:?package=RES.Configuration&version=1.0.0

Configuration

A C# library for strongly typed Configuration with validation

Build status

Quality Gate

codecov

Example Usage (Configuration is the class provided by this repo)

public class EconomicModelConfiguration, ICurrencyConversionConfiguration, IConcreteCostConfiguration 
{
    readonly Configuration configuration;
    
    public EconomicModelConfiguration(Configuration configuration) {
        Contract.Requires(configuration != null);

        this.configuration = configuration;
    
        Validate();
    }
    
    void Validate() {
        using (var validator = configuration.CreateValidator) {
            validator.Check(() => DefaultCurrency);
            validator.Check(() => DefaultConcreteCost);
        }
    }

    public string DefaultCurrency => 
        configuration.GetEnum<Currency>(MethodBase.GetCurrentMethod());

    public double DefaultConcreteCost => 
        GetDouble(MethodBase.GetCurrentMethod());
}

More details on motivation and philosophy in Taming configuration in C# blog post.

Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.0

    • No dependencies.

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
2.0.1 2,376 1/6/2020
2.0.0 1,787 1/18/2019
1.0.0 4,538 3/13/2018

Initial Release