namespace SOR.Collection; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using SOR.Collection.Handlers; using SOR.Database; using SOR.Networking.Abstractions.Messaging; /// /// Registers all collection service components into the DI container. /// Called from SOR.Host/Program.cs when ENABLED_SERVICES includes "collection". /// public static class ServiceRegistration { public static IServiceCollection AddCollectionService( this IServiceCollection services, IConfiguration configuration) { // Database contexts the collection service needs. services.AddCollectionDatabase(configuration); services.AddCatalogDatabase(configuration); // Message handlers — one per message type, Transient lifetime. // MessageDispatcher collects all IMessageHandler registrations at startup. services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); return services; } }