IConfigSource config = new FileConfigSource("app.config"); string connectionString = config.GetValue("connectionString"); int timeout = config.GetIntValue("timeout");
IConfigSource config = new JsonConfigSource("logging.json"); LogLevel level = config.GetEnumValue("level"); string fileNamePattern = config.GetValue("fileNamePattern");
IConfigSource config = new CustomConfigSource(); string connectionString = config.GetValue("connectionString");This code creates an instance of a custom implementation of IConfigSource, which retrieves configuration data from a non-standard source, such as a database or a web service. Then, it retrieves a connection string from the source using GetValue() method. Package library: N/A (custom implementation)