NuGet ยท nuget

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.ConfigFiles

Core ConfigFile-Types for Eltheon Framework

Install

Install-Kommandos

dotnet add package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.ConfigFiles --version 2.9.4.3
<PackageReference Include="Redeon.SuperSiteEngineCore.Web.Eltheon.Core.ConfigFiles" Version="2.9.4.3" />
paket add Redeon.SuperSiteEngineCore.Web.Eltheon.Core.ConfigFiles --version 2.9.4.3
Install-Package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.ConfigFiles -Version 2.9.4.3

README

Vorschau

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.ConfigFiles

Overview

This package manages hierarchical configuration for Eltheon. It contains base config file abstractions, serializers, discovery helpers, and the extension methods used by GlobalConfig to load strongly typed configuration objects from disk.

Capabilities

  • BaseConfigFile<T> handles JSON persistence (with polymorphic support) and path management using GlobalConfig.
  • ConfigsFile keeps a list of discovered IConfig implementations. GlobalConfig.Configs() bootstraps this file and scans all loaded assemblies for classes implementing IConfig.
  • Extension methods like GlobalConfig.GetConfig<T>() allow any feature to fetch its config payload without knowing the storage layout.
  • ConfigOptionsProviderAttribute, IConfigOptionsProvider, and IConfigOptionsResolver provide dynamic option metadata for admin configuration fields without hard-coding feature-specific select lists in the UI.
  • ConfigCollectionItemProviderAttribute, ConfigCollectionItemDescriptor, IConfigCollectionItemProvider, and IConfigCollectionItemResolver describe concrete item types for polymorphic collections such as List<TBase> or List<TInterface>.
  • AddConfigsStore() registers ConfigFiles-owned canonical event metadata, dynamic option resolution, and polymorphic collection item resolution for safe configuration and template-owned database configuration signals.

Usage

  1. Ensure GlobalConfig.Initialize(path) has been invoked so config directories exist.
  2. Create a class implementing IConfig and place it in any loaded assembly.
  3. Add dynamic field options with [ConfigOptionsProvider(typeof(MyProvider))] when a property should render from runtime-provided choices.
  4. Add polymorphic collection item choices with [ConfigCollectionItemProvider(typeof(MyItemProvider))] when a list uses an abstract base type or interface and the admin UI must offer concrete item types.
  5. Call GlobalConfig.Instance.Configs().Load() (or the provided extensions) to populate the config list, then query it via GetConfig<T>().

Notes

  • The package uses Newtonsoft.Json with TypeNameHandling.Auto to persist polymorphic trigger/config types. Do not remove type metadata unless you control all config consumers.
  • JSON deserialization replaces initialized collection instances instead of appending into them. This prevents default list values from being duplicated on repeated load/save cycles.
  • Dynamic option providers and collection item providers are resolved from DI first and fall back to activator-based construction where possible.
  • Collection item descriptors are filtered against the declared collection element type. Disabled or incompatible descriptors must not create posted items.
  • Because the extension scans every loaded assembly, keep config classes lightweight to avoid large static initialization costs at startup.
  • Configuration/data events never include raw values, secrets, or connection strings. Payloads carry config names, changed keys, provider/context names, redaction flags, and generic reason codes only.