Skip to content

Repository files navigation

Simcube.AspNetCore.Modules

CI/CD Pipeline Nuget

Simple Module Support To Facilitate in Minimal Api Vertical Slicing

Organize your project by domain, not technical slices!

Simple module support, nothing else, no extra bloat.

Usage

Create a module

public class InfoModule: IModule
{
    public IServiceCollection RegisterModules(IServiceCollection services)
    {
        services.AddSingleton(new InfoConfig());
        
        return services;
    }

    public IEndpointRouteBuilder MapEndpoints(IEndpointRouteBuilder endpoints)
    {
        endpoints.MapGet("/info", () => {
            ...
        });
        endpoints.MapPost("/info", () => {
            ...
        });
        
        return endpoints;
    }
}

Register Modules, and Endpoints in App builder creation using the extension methods:

var builder = WebApplication.CreateBuilder(args);

builder.RegisterModules();

var app = builder.Build();
app.MapModuleEndpoints();

app.Run();

Sample

See the Sample project here

License

MIT

Free Software, Hell Yeah!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages