using System.Reflection; using GB5Shared.Hosting; namespace PromotionExchangeSL; // IQueryExecutor/IApplicationConnection/HybridCache etc. are already registered once, // globally, by the Host's own Program.cs (same as every other consolidated module) — this // Register() only wires up what's specific to this module, mirroring PartnerModule. public class PromotionExchangeModule : IModule { public void Register(IServiceCollection services, IConfiguration configuration) { var bll = Assembly.Load("PromotionExchangeBLL"); var dal = Assembly.Load("PromotionExchangeDAL"); services.Scan(scan => scan .FromAssemblies(bll, dal) .AddClasses(c => c.Where(t => !t.IsAbstract && !t.IsInterface && (t.Namespace == null || !t.Namespace.Contains(".DTO")))) .AsImplementedInterfaces() .WithScopedLifetime()); } // PromotionExchangeController is a plain MVC controller discovered automatically via // the Host's own AddControllers()/MapControllers() (PlatformHost directly references // this assembly), not via FastEndpoints — nothing to map here. public void MapEndpoints(WebApplication app) { } }