using Microsoft.Extensions.DependencyInjection; namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer; /// /// DI registration extensions for the Data Connection Layer. /// public static class ServiceCollectionExtensions { /// Registers Data Connection Layer options and core services. /// The DI service collection to register into. /// The same instance for chaining. public static IServiceCollection AddDataConnectionLayer(this IServiceCollection services) { services.AddOptions() .BindConfiguration("DataConnectionLayer"); services.AddOptions() .BindConfiguration("OpcUa"); services.AddOptions() .BindConfiguration("MxGateway"); // WP-34: Register the factory for protocol extensibility services.AddSingleton(); return services; } /// Placeholder for actor registration; Data Connection Layer actors are created inside the ActorSystem. /// The DI service collection. /// The same instance for chaining. public static IServiceCollection AddDataConnectionLayerActors(this IServiceCollection services) { // Actor registration happens in AkkaHostedService or SiteCommunicationActor setup. // DataConnectionManagerActor and DataConnectionActor instances are created by the actor system. return services; } }