Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.41 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.41 KB

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!