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
<PackageReference Include="NPv.AspNetCore.Endpoints" Version="0.1.0" />
<PackageVersion Include="NPv.AspNetCore.Endpoints" Version="0.1.0" />
<PackageReference Include="NPv.AspNetCore.Endpoints" />
paket add NPv.AspNetCore.Endpoints --version 0.1.0
#r "nuget: NPv.AspNetCore.Endpoints, 0.1.0"
#:package NPv.AspNetCore.Endpoints@0.1.0
#addin nuget:?package=NPv.AspNetCore.Endpoints&version=0.1.0
#tool nuget:?package=NPv.AspNetCore.Endpoints&version=0.1.0
NPv.AspNetCore.Endpoints
Reusable ASP.NET Core endpoint infrastructure for applications built with the NPv CQS and Result Pattern abstractions.
The package provides:
- an
IEndpointcontract 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
ResultandResult<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 | Versions 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. |
-
net10.0
- NPv.CQS.Abstractions (>= 3.0.0)
- NPv.ExecutionContext.Abstractions (>= 2.0.0)
- NPv.ResultPattern (>= 2.0.0)
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 |