SanteDB typically uses the configuration file and the IFeature mechanism for advanced configurations. However, SanteDB also runs within Docker and Kubernetes environments. These are configured using the IDockerFeature interface.
For example, to expose FOO as a feature on the SDB_FEATURE and provide a parameter called BAR which is leveraging the application settings part of the configuration file:
/// <summary>/// A sample docker feature/// </summary>publicclassFooDockerFeature:IDockerFeature{publicconststring FooBarSetting ="BAR"; /// <summary> /// This is the feature ID on the SDB_FEATURE /// </summary>publicstring Id =>"FOO"; /// <summary> /// Settings for the foobar feature /// </summary>publicIEnumerable<string> Settings =>newString[] { FooBarSetting }; /// <summary> /// Configure this service /// </summary>publicvoidConfigure(SanteDBConfiguration configuration,IDictionary<string,string> settings) { // We can fetch the settings for our feature (parsed from docker // environment) with the settings parameterif (!settings.TryGetValue(FooBarSetting,outstring fooBar)) { fooBar ="Hello World!"; } // Set my settingsconfiguration.AddSection(newFooBarConfigurationSection() { Bar = fooBar }); // Add foobar services var serviceConfiguration = configuration.GetSection<ApplicationServiceContextConfigurationSection>().ServiceProviders;
serviceConfiguration.Add(newTypeReferenceConfiguration(typeof(FooBarService))); }}