An IConfiguration implementation for receiving configuration from a MongoDB database
Install-Package MongoConfiguration
- Create a
MongoConfigurationSettings
object with needed configuration - Use the extension method
AddMongoProvider
- Use IConfiguration in a constructor and use like you would use with any other provider
MongoConfigurationSettings mongoConfigurationSettings = new MongoConfigurationSettings
{
ConnectionString = "mongodb+srv://test_user:[email protected]/test",
DatabaseName = "configuration_db",
CollectionName = "configuration_collection",
KeyName = "MyKey",
KeyValue = "mykeyvalue"
};
var builder = new ConfigurationBuilder()
.AddMongoProvider(mongoConfigurationSettings);
- Fork it (https://github.com/javitolin/MongoConfiguration/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Distributed under the MIT license.