Interface IConfigurator<T>
Base interface of a dynamically loaded configurator.
public interface IConfigurator<T>
Type Parameters
TType of the target builder to add configuration
- Extension Methods
Remarks
Objects of classes implementing this interface can be loaded from configuration sections like:
webHosting.configuratorapplicationMiddlewareapplicationServiceslogging.configurator
by the fully qualified class name specified by the type property.
The object loader supports the default constructor or a constructor taking a single Dictionary<string, string> as parameter.
Once an instance of this configurator object has been created the method AddTo(T target, IConfiguration cfg) is called.
targetgives a target builder of typeTto add the configuration.cfgrepresents the current configuration section
An example configuration woul look like this:
"Persistence.SqLiteDbProvider": {
"type": "Tlabs.Data.Store.SqliteConfigurator, App.SqLiteDataStore",
"config": {
"connection": "DataSource=rsc/store/__app.sqlite;Foreign Keys=True", //;Default Timeout=35;Pooling=True"
"migrationAssembly": "App.dataStore"
}
},
NOTE: The properties of the config object would be available with the Dictionary<string, string> parameter passed to the ctor...
Methods
AddTo(T, IConfiguration)
Method called to add a specific configuration to a target.
void AddTo(T target, IConfiguration cfg)
Parameters
targetTcfgIConfiguration