using System.Reflection; using GB5Shared.Hosting; using SkillManagementBLL.Common; using SkillManagementSL.EndPoints.Hubs; namespace SkillManagementSL; public class SkillManagementModule : IModule { public void Register(IServiceCollection services, IConfiguration configuration) { services.AddSignalR(options => { options.EnableDetailedErrors = true; options.KeepAliveInterval = TimeSpan.FromSeconds(15); options.ClientTimeoutInterval = TimeSpan.FromSeconds(60); options.MaximumReceiveMessageSize = 32 * 1024; }); services.AddSingleton(); // Scrutor assembly scan — SkillManagementBLL + SkillManagementDAL var skillManagementBLLAssembly = Assembly.Load("SkillManagementBLL"); var skillManagementDALAssembly = Assembly.Load("SkillManagementDAL"); services.Scan(scan => scan .FromAssemblies(skillManagementBLLAssembly, skillManagementDALAssembly) .AddClasses(c => c.Where(t => !t.IsAbstract && !t.IsInterface && (t.Namespace == null || !t.Namespace.Contains(".DTO")))) .AsImplementedInterfaces() .WithScopedLifetime()); } public void MapEndpoints(WebApplication app) { app.MapHub("/hubs/skill"); } }