Skip to content

cohen990/EasyConfig.Net.Core

Repository files navigation

EasyConfig.Net.Core

Easily manage configuration within your .net core application

Build Status

NuGet Version and Downloads count

Prerequisites

  • Install dot net core for your platform

Run the Sample

  • cd to working directory
  • cd EasyConfig.Net.Sample
  • dotnet restore
  • dotnet run uri_required=http://www.google.com string_required_commandline=string1 string_sensitive_required=sensitiveinformation overridable-required=overriden-in-command-line day-of-week=tuesday

Run the Tests

  • cd to working directory
  • cd EasyConfig.UnitTests
  • dotnet restore
  • dotnet test

Features

  • Strongly typed parameters
    • Uri
    • String
    • Int
    • Enums (case insensitive)
  • Configuration Sources
    • Environment Variables
    • Command Line Arguments
    • Json Config files
  • Overridable Configuration

Coming Soon

  • Other missing parameter types

Uri

Must be an absolute Uri. Throws a ConfigurationTypeException if unable to parse a Uri

String

Can be pretty much anything but cannot yet contain spaces

Int

Can be an int. Throws a ConfigurationTypeException if unable to parse a valid int

Enums

Can be any enum - will default to the default value of that enum if it is not provided. Throws an EnumConfigParseException if it fails to parse correctly

Nullable Enums

Can be any enum - will default to null if not provided. Throws an EnumConfigParseException if it fails to parse correctly

Things you need to know about versions

V4

Cannot guarantee that the internal functionality remains the same. Large refactors of the internal code have taken place and efforts have been taken to preserve the original contract, but the risk of some nuanced detail changing forces me to update the major version number again.

The old contract is still honoured, but if you have been relying on a quirk of the library then I cannot guarantee that it will still operate the same way.

V3

Has been upgraded to dotnet core 2.0

About

A library for importing settings from json, environment and command line with a focus on providing clear output and clear information to the user

Resources

License

Stars

Watchers

Forks

Packages

No packages published