Installation
Get AxisEndpoints installed in your project. See the Installation guide.
AxisEndpoints is a DSL for implementing the Request-Endpoint-Response (REPR) pattern in ASP.NET Core. It consolidates each API endpoint into a self-contained class with a clear, explicit programming interface.
using AxisEndpoints;
namespace AxisEndpoints.Tutorial.Features.Hello;
public record HelloRequest{ public required string Name { get; set; } = string.Empty;}
public record HelloResponse{ public required string Message { get; set; } = string.Empty;}
public class HelloEndpoint(ILogger<HelloEndpoint> logger) : IEndpoint<HelloRequest, Response<HelloResponse>>{ public void Configure(IEndpointConfiguration config) { config .Get("/hello") .Summary("Hello") .Description("This endpoint takes a name as input and returns a greeting message."); }
public Task<Response<HelloResponse>> HandleAsync( HelloRequest request, CancellationToken cancel) { logger.LogInformation("Received request to /hello with name: {Name}", request.Name);
return Task.FromResult( new Response<HelloResponse> { Body = new HelloResponse { Message = $"Hello, {request.Name}!" }, } ); }}TypedResults or ActionResult<T> annotations.ASP.NET Core offers three approaches to building Web APIs. Each involves different trade-offs:
| Minimal API | Controller | REPR Pattern (AxisEndpoints) | |
|---|---|---|---|
| Structure | Functions registered inline | Methods grouped in a class | One class per endpoint |
| Scalability | ⚠ Can become hard to manage as endpoints grow | ⚠ Controllers can grow bloated over time | ✅ Each endpoint stays self-contained |
| Coupling | Low — but no enforced structure | Medium — CRUD operations share a controller | Low — slices are independent by design |
| Learning curve | Low | Medium (MVC conventions) | Medium (built on Minimal API) |
| Best suited for | Small services, prototypes | CRUD-heavy APIs familiar to MVC developers | Feature-rich APIs, Vertical Slice Architecture |
The REPR pattern is a good choice when:
To implement the REPR pattern in ASP.NET Core, you can either write a thin wrapper around the Minimal API yourself, or use a library such as FastEndpoints. FastEndpoints is powerful, but its abstractions diverge noticeably from standard ASP.NET Core conventions, which steepens the learning curve. AxisEndpoints takes a different approach: it stays close to the Minimal API surface, so the concepts you already know continue to apply.
Installation
Get AxisEndpoints installed in your project. See the Installation guide.
Guides
Learn how to define endpoints, bind requests, handle responses, and more. See the Guides.
CSV Extension
Add typed CSV import and export to your endpoints with the optional CsvHelper extension. See the CSV Helper extension.
FAQ
Find answers to common questions in the FAQ.