namespace SOR.Chat;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SOR.Chat.Handlers;
using SOR.Database;
using SOR.Networking.Abstractions.Messaging;
///
/// Registers all chat service components into the DI container.
/// Called from SOR.Host/Program.cs when ENABLED_SERVICES includes "chat".
///
public static class ServiceRegistration
{
public static IServiceCollection AddChatService(
this IServiceCollection services,
IConfiguration configuration)
{
// Database contexts the chat service needs.
services.AddChatDatabase(configuration);
services.AddIdentityDatabase(configuration);
// Message handlers — one per message type, Transient lifetime.
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
return services;
}
}