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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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
- Get Started
- Support for data types
- Custom config file location
- Custom config file naming rules
- Custom Section format
- Custom location, naming rules, and Section format
Chinese wiki
Product | Versions 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,061 | 1/25/2018 |