NPv.AspNetCore.Endpoints 0.1.0

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

NPv.AspNetCore.Endpoints

Reusable ASP.NET Core endpoint infrastructure for applications built with the NPv CQS and Result Pattern abstractions.

The package provides:

  • an IEndpoint contract for self-contained endpoint modules;
  • discovery and registration of endpoint modules from application assemblies;
  • concise Minimal API mappings for commands with and without results;
  • command mappings that construct a context using the current IUserContext;
  • conversion of Result and Result<T> values to HTTP responses;
  • Data Annotations request validation through an endpoint filter.

Authentication and authorization policies remain the responsibility of the host application. The package does not depend on a particular authentication scheme, Auth domain, or application-specific model.

Status

This package is at an early stage (0.x). Its public API and runtime behavior may change between minor versions.

Installation

dotnet add package NPv.AspNetCore.Endpoints

The consuming application uses ASP.NET Core and must provide the NPv CQS, execution-context, and result-pattern services required by its endpoints.

Defining an endpoint

Implement IEndpoint in an application or feature assembly:

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using NPv.AspNetCore.Endpoints.Abstractions;
using NPv.AspNetCore.Endpoints.Mappings;

public sealed class CreateItemEndpoint : IEndpoint
{
    public RouteHandlerBuilder MapEndpoint(IEndpointRouteBuilder endpoints) =>
        endpoints
            .MapCommand<CreateItemCommand>("/api/items")
            .RequireAuthorization()
            .WithTags("items");
}

Authorization is applied explicitly by the consuming endpoint and is not imposed by the package.

Discovering endpoints

Register endpoint modules from one or more assemblies in the application host:

using NPv.AspNetCore.Endpoints.Discovery;

app.MapEndpoints([
    "MyApplication.Features",
    "MyApplication.Pages"
]);

Discovered endpoint modules must implement IEndpoint and have a parameterless constructor. The shared validation filter is attached automatically during registration.

Result responses

ToIResult converts successful and failed NPv results into ASP.NET Core responses:

using NPv.AspNetCore.Endpoints.Helpers;

var result = await executor.ExecuteAsync(command, cancellationToken);
return result.ToIResult();

A successful Result produces 200 OK. A successful Result<T> produces 200 OK with its value. Failures produce 400 Bad Request with errors grouped by property.

Author's Note

This library grew out of my long-standing personal interest in structuring and publishing open source packages. Over time, I’ve revisited and refined earlier internal utilities and ideas, giving them a more consistent shape and preparing them for wider reuse. Along the way, I’ve also taken the opportunity to explore how open source distribution and licensing work in the .NET ecosystem.

It’s a small step toward something I’ve always wanted to try — sharing practical, minimal tools that reflect years of learning, experimentation, and refinement.

Hopefully, someone finds it useful.

Nikolai 😛

⚖️ License

MIT — you are free to use this in commercial and open-source software.

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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NPv.AspNetCore.Endpoints:

Package Downloads
NPv.Auth.AspNetCore

ASP.NET Core endpoints, cookie handling, claims helpers, and service registration for NPv authentication modules.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 183 7/31/2026