Module discovery, registration, and pipeline configuration for modular web applications.
$ dotnet add package Fluens.Web.ModularityModule discovery, registration, and pipeline configuration for modular web applications.
dotnet add package Fluens.Web.Modularity
public class OrdersModule : ModuleSetup
{
// Name derived from namespace: "orders"
public override void RegisterServices(IFluensModuleBuilder module)
{
module
.AddEndpoints()
.AddHandlers()
.AddValidators()
.AddDataProviders()
.AddMessaging<OrdersDbContext>(msg =>
{
msg.Publishes<PaymentCompletedMessage>();
});
}
public override void Use(WebApplication app)
{
// Module-specific middleware or route configuration
}
}
// Register all modules
fluensBuilder.AddModules(typeof(OrdersModule).Assembly);
// Apply module pipelines
app.UseModules();
This project is licensed under the MIT License.