Emrys.SuperConfig 1.0.0

dotnet add package Emrys.SuperConfig --version 1.0.0
NuGet\Install-Package Emrys.SuperConfig -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="Emrys.SuperConfig" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Emrys.SuperConfig --version 1.0.0
#r "nuget: Emrys.SuperConfig, 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 Emrys.SuperConfig as a Cake Addin
#addin nuget:?package=Emrys.SuperConfig&version=1.0.0

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

Emrys.SuperConfig

It is easier to use configuration in .Net.

在.Net中更加容易的使用配置文件。

Get Started

1.A new class name is UserInfo

class UserInfo
{
    public string UserName { get; set; }
    public string Email { get; set; }
    public int Age { get; set; }
    public string BlogUrl { get; set; }
    public Color FavoriteColor { get; set; }
    public Color DislikeColor { get; set; } 
    public List<string> Language { get; set; }
   
}
enum Color{Red,Blue,Black} 

2.Configuration in Web.config/App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="userInfo" type="Emrys.SuperConfig.Section,Emrys.SuperConfig"></section>
  </configSections>
  <userInfo userName="Emrys" email="i@emrys.me" age="27">
    <blogUrl>http://www.cnblogs.com/emrys5/</blogUrl>
    <favoriteColor>Blue</favoriteColor>
    <dislikeColor>2</dislikeColor> 
    <language>
      <value>Putonghua</value>
      <value>Huaipu</value>
      <value>English</value>
    </language> 
  </userInfo> 
</configuration>

3.Get config

 var user = SuperConfig<UserInfo>.Value;

Done!!!!!

English wiki

  1. Get Started
  2. Support for data types
  3. Custom config file location
  4. Custom config file naming rules
  5. Custom Section format
  6. Custom location, naming rules, and Section format

Chinese wiki

  1. 开始使用 入门
  2. 支持数据类型
  3. 自定义配置文件位置
  4. 自定义配置文件命名规则
  5. 自定义Section格式
  6. 同时自定义位置、命名规则和Section格式
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  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.

This package has 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
1.0.0 1,058 1/25/2018