< 1 minute to read
Checkout the new MongoDbConfiguration Provider for ASP5. https://www.nuget.org/packages/MongoDb.Asp.ConfigurationProvider/ with support for blank and null keys.
Usage: Use the single line config to load the configuration:
A brief blog post on implementation and open source GIT Path shall soon follow.
5 minutes to read read
Managing the configuration data have always been troublsome. Although Microsoft did provided and also updated/upgraded a lot of options from time to time, yet it remains a challenge most of time. Things get more critical when the configuration data we are concerned is the confidential data like connection string, smtp passwords, API keys etc becase at some point of time, they do get checked in source code or shared across other developers. In one of my prev project faced a similar issue when private key and the Code Signing certificate was accidentally checked in by a developer. The customer had to revoke the certificate which invalidated all the production builds which were deployed to end users as well.
The Solution: ConfigurationBuilder()
With ASP.net there are some pretty cool enhancements that Microsoft added especially with the Configuration Builder. Earlier whole of .net relied on System.Configuration Namespace to get the configuration data. With the current version it has been greatly re-architeced which now provides a simple key value pair from multiple sources prebuild or even custom providers (like azure or mongoDb) which we shall try out in next post.