MESK.MiniEndpoint 1.0.0

dotnet add package MESK.MiniEndpoint --version 1.0.0
                    
NuGet\Install-Package MESK.MiniEndpoint -Version 1.0.0
                    
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="MESK.MiniEndpoint" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MESK.MiniEndpoint" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MESK.MiniEndpoint" />
                    
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 MESK.MiniEndpoint --version 1.0.0
                    
#r "nuget: MESK.MiniEndpoint, 1.0.0"
                    
#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 MESK.MiniEndpoint@1.0.0
                    
#: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=MESK.MiniEndpoint&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MESK.MiniEndpoint&version=1.0.0
                    
Install as a Cake Tool

MESK.MiniEndpoint

MESK.MiniEndpoint is a lightweight library for modular endpoint registration in ASP.NET Core applications. It enables you to define endpoints in a decoupled way and register them automatically via assembly scanning, promoting clean architecture and separation of concerns.

Features

  • Modular endpoint registration: Implement the IEndpoint interface to define endpoints in separate classes.
  • Automatic discovery: Register all endpoint classes in an assembly with a single call.
  • Integration with ASP.NET Core: Easily map endpoints to your application or route groups.
  • Testable and extensible: Designed for easy unit and integration testing.

Getting Started

Installation

Add a reference to the MESK.MiniEndpoint project or NuGet package in your ASP.NET Core application.

Usage
  1. Define an endpoint:
     public class MyEndpoint : IEndpoint
     {
     	public void MapEndpoints(IEndpointRouteBuilder app)
     	{
     		app.MapGet("/hello", () => "Hello, World!");
     	}
     }
    
  2. Register endpoints in Program.cs:
     var builder = WebApplication.CreateBuilder(args);
     builder.Services.AddMiniEndpoints(typeof(MyEndpoint).Assembly);
     var app = builder.Build();
     app.MapMiniEndpoints();
     app.Run();
    
  3. Optional: Use with route groups:
     var apiGroup = app.MapGroup("/api/v1");
     app.MapMiniEndpoints(apiGroup);
    

How It Works

  • Implement the IEndpoint interface for each endpoint class.
  • AddMiniEndpoints(assembly) scans the assembly for all non-abstract, non-interface classes implementing IEndpoint and registers them as transient services.
  • MapMiniEndpoints resolves all registered endpoints and calls their MapEndpoints method to map routes.

Testing

Unit and integration tests are provided in the MESK.MiniEndpoint.Test project. Tests cover:

  • Registration of valid endpoints
  • Exclusion of abstract classes and interfaces
  • Transient service lifetime
  • Integration with ASP.NET Core pipeline

To run tests:

dotnet test MESK.MiniEndpoint.Test

Requirements

  • .NET 9.0 or later
  • ASP.NET Core

License

MIT License


Created by Mehmet Solak

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.
  • net9.0

    • No dependencies.

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.0 201 8/27/2025