24026b25e2
Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.ManagementService;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// Registers the management actor holder and management service options.
|
|
/// </summary>
|
|
/// <param name="services">The service collection to register into.</param>
|
|
/// <returns>The <paramref name="services"/> instance for chaining.</returns>
|
|
public static IServiceCollection AddManagementService(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<ManagementActorHolder>();
|
|
// Flow Debugger (design 2026-09-05 §7.1): the runner behind the four FlowDebug* commands (three Live runs + Replay).
|
|
services.AddSingleton<FlowDebug.FlowDebugRunner>();
|
|
services.AddOptions<ManagementServiceOptions>()
|
|
.BindConfiguration("ScadaBridge:ManagementService")
|
|
.ValidateOnStart();
|
|
services.TryAddEnumerable(
|
|
ServiceDescriptor.Singleton<IValidateOptions<ManagementServiceOptions>,
|
|
ManagementServiceOptionsValidator>());
|
|
return services;
|
|
}
|
|
}
|