DKNet.AspCore.Extensions 10.1.10

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

DKNet.AspCore.Extensions

NuGet License: MIT

The minimal-API glue for DKNet-based ASP.NET Core web APIs: claim-backed request binding, versioned endpoint-group discovery, one-line SlimMessageBus mapping helpers, a shared paging envelope, and FluentResults-to-IResult/ProblemDetails conversion.

Installation

dotnet add package DKNet.AspCore.Extensions

Features

  • Contextual request binding[FromClaim] (and any custom IContextualSource) populates a request property from the authenticated caller before validation and before the handler runs, so it can never be forged through the request body or querystring; automatically excluded from the published OpenAPI description.
  • Endpoint group discovery — implement IEndpointConfig per feature area and let UseEndpointConfigs() discover, version, tag, and authorize every group across your assemblies.
  • Fluent minimal-API mappersMapPost/MapPut/MapPatch/MapDelete/MapGet/MapGetPage wire a verb straight onto a SlimMessageBus fluent command/query, plus generic MapGetById/ MapGetList backed by DKNet.EfCore.Specifications.
  • PagedResponse<T> — a shared paging envelope (PageNumber, PageSize, PageCount, TotalItemCount, Items, HasNextPage, HasPreviousPage) used by every paged endpoint.
  • Result/ProblemDetails conversionResponse()/Response<T>() turn a FluentResults outcome into the right minimal-API IResult; ToProblemDetails() does the same for a ModelStateDictionary.

Quick Start

Register the pieces you need and let UseEndpointConfigs do the mapping:

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddAuthorization();
builder.Services.AddApiVersioning();
builder.Services.AddContextualRequestPopulation(); // powers [FromClaim] and friends

var app = builder.Build();
app.UseEndpointConfigs(); // discovers every IEndpointConfig across the loaded assemblies
app.Run();
using System.Security.Claims;
using DKNet.AspCore.Extensions;
using DKNet.AspCore.Extensions.ModelBinding;
using DKNet.SlimBus.Extensions;

public sealed record CreateProductCommand : Fluents.Requests.IWitResponse<ProductModel>
{
    public string Name { get; init; } = string.Empty;

    [FromClaim(ClaimTypes.NameIdentifier)]
    public string? CreatedBy { get; set; } // always resolved from the caller's claim, never from the body
}

public sealed class ProductsEndpointConfig : IEndpointConfig
{
    public string GroupEndpoint => "/products";

    public void Map(RouteGroupBuilder group) =>
        group.MapPost<CreateProductCommand, ProductModel>("/");
}

POST /v1/products now dispatches CreateProductCommand through IMessageBus, resolves CreatedBy from the caller's claim before the handler runs, and returns 201 Created (the mapper infers "Created" from the command's type name) with a FluentResults-derived ProblemDetails body on failure.

Migration — namespace changes in this release

Root types were grouped into concern folders; the namespace of each moved type now ends with its folder name. This is an import-only source break: no type was renamed, removed, resignatured, or had its behaviour changed — update the using line and you're done.

Type Old namespace New namespace
IContextualSource, FromClaimAttribute, ContextualValueResolver, ContextualRequestPopulation (+ its internal helpers), ContextualSourceOpenApiTransformers DKNet.AspCore.Extensions DKNet.AspCore.Extensions.ModelBinding
EndpointConfigExtensions (incl. EndpointRegistrationOptions, UseEndpointConfigs), FluentEndpointMapperExtensions DKNet.AspCore.Extensions DKNet.AspCore.Extensions.Endpoints
PagedResponse<T>, ProblemDetailsExtensions, ResultResponseExtensions DKNet.AspCore.Extensions DKNet.AspCore.Extensions.Responses

IEndpointConfig — the package's entry surface — stays at DKNet.AspCore.Extensions.

Full Documentation

See the full feature guide for contextual-source resolvers, EndpointRegistrationOptions, all fluent mappers, paging details, and gotchas.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Developed by Steven Hoang.

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

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
10.1.10 0 8/22/2026
10.1.9 36 8/22/2026
10.1.8 37 8/21/2026
10.1.7 53 8/21/2026
10.1.6 41 8/21/2026
10.1.5 49 8/20/2026
10.1.4 48 8/20/2026
10.1.3 53 8/19/2026
10.1.2 48 8/19/2026