MinimalApi.Endpoints.Organizer 1.0.1

dotnet add package MinimalApi.Endpoints.Organizer --version 1.0.1
                    
NuGet\Install-Package MinimalApi.Endpoints.Organizer -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MinimalApi.Endpoints.Organizer" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinimalApi.Endpoints.Organizer" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="MinimalApi.Endpoints.Organizer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MinimalApi.Endpoints.Organizer --version 1.0.1
                    
#r "nuget: MinimalApi.Endpoints.Organizer, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MinimalApi.Endpoints.Organizer@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MinimalApi.Endpoints.Organizer&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=MinimalApi.Endpoints.Organizer&version=1.0.1
                    
Install as a Cake Tool

MinimalApi.Endpoints.Organizer

NuGet Version

An elegant and robust abstraction for organizing and configuring Minimal API endpoints.

This package simplifies the creation and registration of endpoints by providing a convention-based approach, allowing you to define endpoint configuration in a single, reusable class.

Key Features

  • Convention-Based Routing: Automatically discovers and registers endpoints that implement the IEndpoint interface.
  • Fluent Configuration API: Use a fluent builder pattern to easily set prefixes, tags, and OpenAPI settings for a group of endpoints.
  • Centralized Configuration: Define all endpoint metadata (like Tags and Prefix) in a separate and clear configuration class.
  • OpenAPI Integration: Easily include or exclude entire endpoint groups from your OpenAPI documentation.

Installation

Install the package into your ASP.NET Core project using the .NET CLI:

Getting Started

To use the package follow these three simple steps:

Step 1: Define Your Endpoint Configuration

Create a configuration class that inherits from EndpointsConfiguration and use the fluent methods to set your desired properties.

// In your Endpoints/UserEndpointsConfiguration.cs
using MinimalApi.Endpoints.Organizer.Abstractions;

public class UserEndpointsConfiguration : EndpointsConfiguration
{
    public UserEndpointsConfiguration()
    {
        .WithPrefix("/users/v2");
        .WithTags("Users", "User Management");
        .WithOpenApi(true);
    }
}

Step 2: Implement the Endpoint

Create an endpoint class that implements IEndpoint<TConfiguration> where TConfiguration is your new configuration class.

// In your Endpoints/GetUsersEndpoint.cs
using Microsoft.AspNetCore.Routing;
using MinimalApi.Endpoints.Organizer.Abstractions;

public class GetUsersEndpoint : IEndpoint<UserEndpointsConfiguration>
{
    public RouteHandlerBuilder MapEndpoint(IEndpointRouteBuilder app)
    {
        return app.MapGet("/", GetUsersHandler);
    }

    private static async Task<string> GetUsersHandler() 
    {
        return "users";
    }
}

Step 3: Register All Endpoints in Program.cs

Call the MapEndpoints extension method in your Program.cs file. It will automatically scan the specified assembly and register all endpoints.


// In your Program.cs
using System.Reflection;
using MinimalApi.Endpoints.Organizer.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

// This single line registers all your endpoints
app.MapEndpoints(Assembly.GetExecutingAssembly());

app.Run();
You can also pass a lambda for some extra configurations in the app.MapEndpoints after giving the desired Assembly, so this lets you configure a BasePrefix and Configure the endpoints group to add filters or global configurations:
app.MapEndpoints(Assembly.GetExecutingAssembly(), options => 
{
    options.BasePrefix = "/api";
    options.ConfigureGroup = group => 
    {
        group.AddEndpointFilter<ResultHttpCodeFilter>();
        group.WithOpenApi();
    };
});

That's it! Your GetUsersEndpoint is now automatically available at /users/v2 with the Users and User Management tags.

For any further suggest or feature that you would like to see don't hesitate to contact me via E-mail: feolaezequiel@gmail.com.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 318 12/18/2025
1.0.0 296 12/18/2025