9cff87fe85
Remove project bookkeeping citations from shipped code comments across the solution: hyphenated task IDs (WP-14, StoreAndForward-025), milestone/task/ issue refs (M3, Task 4, Audit Log #23, #21), Bundle X task-bundle labels, and C/D/K/S/T phase labels. Comment text only — no code logic, string/log literals, or XML-doc structure changed. Genuine descriptions are preserved (only the citation is stripped), and technical lookalikes are retained (UTF-8, SHA-256, T00:00:00, M365, UTC-5, pre-C4/pre-C5 schema versions). Flagged by the new CommentChecker TaskReferenceInComment / TrackingReferenceInComment checks plus targeted grep passes; full solution builds clean, append-only guard tests pass.
45 lines
1.9 KiB
C#
45 lines
1.9 KiB
C#
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using ZB.MOM.WW.Configuration;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.KpiHistory;
|
|
|
|
/// <summary>
|
|
/// Composition root for the KPI History component.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Scaffolds the component: it binds and validates
|
|
/// <see cref="KpiHistoryOptions"/>. The recorder actor itself is created via
|
|
/// <c>Props</c> in the Host on the active central node, not registered
|
|
/// here — mirroring the Notification Outbox singleton wiring.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>Configuration section bound to <see cref="KpiHistoryOptions"/>.</summary>
|
|
public const string OptionsSection = "ScadaBridge:KpiHistory";
|
|
|
|
/// <summary>
|
|
/// Registers the KPI History component services: the validated
|
|
/// <see cref="KpiHistoryOptions"/> binding. Idempotent re-registration of the
|
|
/// validator is handled by the shared <c>AddValidatedOptions</c> helper
|
|
/// (<c>TryAddEnumerable</c>); the options binding itself is call-once per
|
|
/// <see cref="IServiceCollection"/>.
|
|
/// </summary>
|
|
/// <param name="services">The service collection to register into.</param>
|
|
/// <param name="configuration">Application configuration used to bind <see cref="KpiHistoryOptions"/>.</param>
|
|
/// <returns>The same <see cref="IServiceCollection"/> for chaining.</returns>
|
|
public static IServiceCollection AddKpiHistory(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(services);
|
|
ArgumentNullException.ThrowIfNull(configuration);
|
|
|
|
// Binds the "ScadaBridge:KpiHistory" section, registers the validator,
|
|
// and enables ValidateOnStart in one call — same shape as AddAuditLog.
|
|
services.AddValidatedOptions<KpiHistoryOptions, KpiHistoryOptionsValidator>(configuration, OptionsSection);
|
|
|
|
return services;
|
|
}
|
|
}
|