Installation
Get AxisEndpoints installed in your project. See the Installation guide.
AxisEndpoints is a library for implementing the Request-Endpoint-Response (REPR) pattern in ASP.NET Core.
By providing numerous self-contained API endpoints rather than grouping multiple endpoints into a controller class, it enforces a structure where each endpoint is loosely coupled and easier to scale.
using System.Net;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, IResult>{ public void Configure(IEndpointConfiguration config) { config .Get("/hello") .ProducesSuccess<HelloResponse>() .ProducesError(HttpStatusCode.BadRequest) .Summary("Hello") .Description("This endpoint takes a name as input and returns a greeting message."); }
public Task<IResult> HandleAsync(HelloRequest request, CancellationToken cancel) { if (string.IsNullOrWhiteSpace(request.Name)) { logger.LogWarning("Rejected request to /hello because the name was missing."); return Task.FromResult(Results.Problem( title: "Name is required", detail: "Provide a non-empty name query parameter.", statusCode: StatusCodes.Status400BadRequest )); }
logger.LogInformation("Received request to /hello with name: {Name}", request.Name);
return Task.FromResult( Results.Json(new HelloResponse { Message = $"Hello, {request.Name}!" }) ); }}This is the exact endpoint built in the Quick Start tutorial.
AxisEndpoints is built on the following concepts and is designed for web application backend developers who want to enforce a structure where there are many features that are loosely coupled in terms of their functionality and operation.
TypedResults or ActionResult<T> annotations.Since it is built on ASP.NET Core Minimal APIs, developers who have experience with ASP.NET Core API development can apply their existing knowledge.
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.