https://github.com/chugunov/manyconfig
Helper package for easy configuration.
https://github.com/chugunov/manyconfig
appsettings c-sharp config configuration easy
Last synced: about 1 year ago
JSON representation
Helper package for easy configuration.
- Host: GitHub
- URL: https://github.com/chugunov/manyconfig
- Owner: chugunov
- License: mit
- Created: 2016-06-03T14:43:32.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T13:14:29.000Z (over 9 years ago)
- Last Synced: 2025-03-24T18:11:50.492Z (over 1 year ago)
- Topics: appsettings, c-sharp, config, configuration, easy
- Language: C#
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ManyConfig
[](https://badge.fury.io/nu/manyconfig)
[](https://ci.appveyor.com/project/chugunov/manyconfig)
A helper package for easy configuration
## Usage
Add `ManyConfig` attribute to your configuration properties and specify DefaultValue for them.
```csharp
public class ElasticConfig
{
[ManyConfig(Key = "elasticsearch-connection-string",
DefaultValue = "http://localhost:9200")]
public string ConnectionString { get; set; }
[ManyConfig(Key = "elasticsearch-index",
DefaultValue = "comments")]
public string IndexName { get; set; }
}
```
In `app.config` you can override your DefaultValue property by `Key` field:
```xml
```
Then you can use configuration:
```csharp
ElasticConfig elasticConfiguration = ConfigHandler.Get();
```
## TODO
* Covering by test