Quick Start

See πŸ“¦ Installation for NuGet setup.

Decorate a controller class β€” the source generator builds complete Minimal API endpoints automatically:

[AutoGenerateEndpoints(RoutePrefix = "/api/users")]
public class UserController
{
    private readonly UserService _service;
    public UserController(UserService service) => _service = service;

    public async Task<OneOf<ValidationError, NotFoundError, User>>
        GetUser(int id) => await _service.GetUserByIdAsync(id);

    public async Task<OneOf<ValidationError, ConflictError, User>>
        CreateUser(CreateUserRequest request) => await _service.CreateAsync(request);

    public async Task<Result<List<User>>> GetUsers() => await _service.GetAllAsync();
}

Generated automatically β€” zero manual code: - GET /api/users/{id} β†’ 200 / 400 / 404 (HTTP status from OneOf error types) - POST /api/users β†’ 201 / 400 / 409 - GET /api/users β†’ 200 - Full OpenAPI metadata β€” .Produces<T>(), .WithSummary(), .WithTags(), .WithName()

For complete feature documentation see πŸš€ SmartEndpoints, 🌐 ASP.NET Integration, and the sections below.