TS
TS-NuGet-Packages/TS.Endpoints
TS.Endpoints is a lightweight modular routing library for ASP.NET Minimal APIs. Inspired by Carter, it enables clean, class-based endpoint organization without controllers.
TS.Endpoints
TS.Endpoints is a lightweight and modular endpoint registration library for ASP.NET Minimal APIs, inspired by Carter.
It lets you organize your API endpoints into clean, maintainable classes without using controllers.
๐ Features
- โ Minimal API support
- โ
Modular design with
IEndpointinterface - โ Automatic discovery via reflection
- โ
Fluent route mapping with
MapEndpoints() - โ Support for single or multiple assemblies
- โ
Compatible with
WithTags,WithName, and Swagger (optional extensions)
๐ฆ Installation
dotnet add package TS.Endpointsโ๏ธ Usage
1. Create an endpoint module:
using Microsoft.AspNetCore.Routing;
using TS.Endpoints;
public class ProductEndpoints : IEndpoint
{
public void AddRoutes(IEndpointRouteBuilder builder)
{
var group = builder.MapGroup("/products").WithTags("Products");
group.MapGet("/", () => Results.Ok("Get all products"))
.WithSummary("GetAllProducts"); // => Optional
group.MapPost("/", () => Results.Ok("Create product"))
.WithSummary("CreateProduct"); // => Optional
}
}2. Register and map endpoints in Program.cs:
builder.Services.AddEndpoint(); // Scans current assembly
// or specify multiple assemblies
builder.Services.AddEndpoint(
typeof(ProductEndpoints).Assembly,
typeof(OtherEndpoints).Assembly
);
var app = builder.Build();
app.MapEndpoints();๐ค Contributing
Contributions are welcome via pull requests and issues.
If you find this useful, star the repo and share it โญ
๐ License
MIT License
On this page
Languages
C#100.0%
MIT License
Created July 19, 2025
Updated November 13, 2025