Class ConfigurationSetStateStoreExtensions
Registers a self-describing JSON control file for configuration-set coordinators known at startup.
Inherited Members
Namespace: Eigenverft.NetLib.Infrastructure.Hosting.Configuration.ConfigurationSets
Assembly: Eigenverft.NetLib.Infrastructure.dll
Syntax
public static class ConfigurationSetStateStoreExtensions
Methods
| Edit this page View SourceAddConfigurationSetStateFile(IHostApplicationBuilder, string, bool, int)
Adds one configuration-set state file, materializes authoritative metadata, and optionally watches it.
Declaration
public static IConfigurationSetStateStore AddConfigurationSetStateFile(this IHostApplicationBuilder builder, string path, bool watchForChanges = true, int reloadDelayMilliseconds = 250)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostApplicationBuilder | builder | The host application builder containing the set coordinators to manage. |
| string | path | Absolute path, or a path relative to the host content root. |
| bool | watchForChanges | Whether the desired-state control file is watched for edits after startup. |
| int | reloadDelayMilliseconds | Debounce delay for physical file notifications. |
Returns
| Type | Description |
|---|---|
| IConfigurationSetStateStore | The runtime state-store instance, also registered as a singleton through DI. |
Remarks
The store captures coordinators and their state apply modes registered before this call. Missing files are created from the
current desired state. AllowedValues and ApplyMode in the file are descriptive metadata only; registered code
remains authoritative. Unknown set names or disallowed values reject the document before any set is switched. Runtime
operational failures in one otherwise-valid independent set do not roll back successful transitions of another independent set.
SetConfigurationSetApplyMode(IHostApplicationBuilder, string, ConfigurationSetApplyMode)
Sets the code-owned desired-state apply mode for one already registered configuration set.
Declaration
public static IHostApplicationBuilder SetConfigurationSetApplyMode(this IHostApplicationBuilder builder, string setName, ConfigurationSetApplyMode applyMode)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostApplicationBuilder | builder | The host application builder containing the configuration set. |
| string | setName | The registered configuration-set name. |
| ConfigurationSetApplyMode | applyMode | Whether desired-state changes may apply at runtime or only during startup. |
Returns
| Type | Description |
|---|---|
| IHostApplicationBuilder | The same builder for chaining. |
Remarks
This policy belongs to desired-state control, not to IConfigurationSetCoordinator. Direct coordinator switches remain technically possible regardless of this setting. The policy is frozen when the state store is registered.