CoreMesh.Endpoints 0.1.0

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

繁體中文 | English

CoreMesh.Endpoints

CoreMesh.Endpoints provides a lightweight endpoint discovery and mapping abstraction for ASP.NET Core.

It allows you to:

  1. Define endpoints as classes
  2. Register endpoint implementations through assembly scanning
  3. Map normal endpoints and grouped endpoints in one place

Features

  • IEndpoint: map root endpoints
  • IGroupEndpoint: define a route group and configure shared metadata
  • IGroupedEndpoint<TGroup>: map endpoints under a specific group
  • AddEndpoints(): scan loaded assemblies and register endpoint types
  • MapEndpoints(): map registered endpoints to WebApplication

Installation

Reference the project/package and call:

using CoreMesh.Endpoints.Extensions;

builder.Services.AddEndpoints();

var app = builder.Build();

app.MapEndpoints();

Core Interfaces

IEndpoint

Use for root endpoints:

using CoreMesh.Endpoints;

public sealed class PingEndpoint : IEndpoint
{
    public void AddRoute(IEndpointRouteBuilder app)
    {
        app.MapGet("/ping", () => Results.Ok("pong"));
    }
}

IGroupEndpoint + IGroupedEndpoint<TGroup>

Use when you want a route group with shared configuration:

using CoreMesh.Endpoints;

public sealed class ProductsGroup : IGroupEndpoint
{
    public string GroupPrefix => "/products";

    public void Configure(RouteGroupBuilder group)
    {
        group.WithTags("Products");
    }
}

public sealed class GetProductsEndpoint : IGroupedEndpoint<ProductsGroup>
{
    public void AddRoute(RouteGroupBuilder group)
    {
        group.MapGet("/", () => Results.Ok(Array.Empty<object>()));
    }
}

Design Notes (Current Version)

  • Endpoint discovery uses AppDomain.CurrentDomain.GetAssemblies()
  • Endpoints are currently registered as Singleton
  • Mapping is convention-based using implemented interfaces (IEndpoint, IGroupEndpoint, IGroupedEndpoint)

These behaviors are intentionally kept close to the original implementation and may be refined in later iterations.

Testing

Current tests cover:

  1. AddEndpoints() registration for endpoint/group/grouped endpoint types
  2. MapEndpoints() invocation of AddRoute() and group mapping behavior
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.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
0.1.0 136 3/11/2026
0.0.1 86 3/8/2026