DotEmilu.AspNetCore 10.0.0

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

DotEmilu.AspNetCore

NuGet License: MIT

ASP.NET Core integration for DotEmilu — bridges use-case handlers to Minimal API endpoints, formats errors as RFC 7807 Problem Details, and provides AsDelegate for zero-boilerplate endpoint wiring.

Install

dotnet add package DotEmilu.AspNetCore

This transitively installs DotEmilu and DotEmilu.Abstractions.

What's included

HTTP handlers

Type Purpose
HttpHandler<TRequest> Wraps IHandler<TRequest> — executes handler, checks validation, returns IResult
HttpHandler<TRequest, TResponse> Wraps IHandler<TRequest, TResponse> — same, but with a typed response payload

Delegate helpers

Type Purpose
AsDelegate.ForAsync<TRequest>() Converts a handler into a Func<TRequest, HttpHandler, CancellationToken, Task<IResult>> for Minimal API
AsDelegate.ForAsync<TRequest, TResponse>() Same, for handlers with a response

Presenter

Type Purpose
IPresenter Interface for formatting HTTP responses (Success, ValidationError, ServerError)
Presenter (internal) Default implementation: returns ValidationProblem (400) and Problem (500) using RFC 7807, with dev-mode stack traces

Configuration

Type Purpose
ResultMessage Options class bound to appsettings.json section "ResultMessage" — defines titles and details for validation/server errors

DI registration

Method Purpose
services.AddDotEmilu() Registers IVerifier<>, HttpHandler<>, HttpHandler<,>, IPresenter, and binds ResultMessage from configuration

Endpoint wiring with AsDelegate

The cleanest way to define endpoints — no handler variable, no manual HandleAsync call:

var invoices = app.MapGroup("/invoices");

// POST /invoices → 201 Created
invoices.MapPost("", AsDelegate.ForAsync<CreateInvoiceRequest>(TypedResults.Created));

// GET /invoices → 200 OK with PaginatedList<Invoice>
invoices.MapGet("", AsDelegate.ForAsync<GetInvoicesRequest, PaginatedList<Invoice>>());

// GET /invoices/{id} → 200 OK or 404 Not Found
invoices.MapGet("{id:int}", AsDelegate.ForAsync<GetInvoiceByIdRequest, InvoiceResponse>(
    response => response is null ? TypedResults.NotFound() : TypedResults.Ok(response)));

// PUT /invoices/{id} → 204 No Content
invoices.MapPut("{id:int}", AsDelegate.ForAsync<UpdateInvoiceRequest>(TypedResults.NoContent));

// DELETE /invoices/{id} → 204 No Content
invoices.MapDelete("{id:int}", AsDelegate.ForAsync<DeleteInvoiceRequest>(TypedResults.NoContent));

Manual HttpHandler usage

If you need more control, inject HttpHandler directly:

app.MapPost("/invoices", async (
    CreateInvoiceRequest request,
    HttpHandler<CreateInvoiceRequest> handler,
    CancellationToken ct) =>
        await handler.HandleAsync(request, ct, () => TypedResults.Created()));

Configuration

Add to appsettings.json:

{
  "ResultMessage": {
    "ValidationError": {
      "Title": "Bad Request",
      "Detail": "One or more validation errors occurred."
    },
    "ServerError": {
      "Title": "Internal Server Error",
      "Detail": "An unexpected error occurred. Please contact the administrator."
    }
  }
}

Full registration

builder.Services
    .AddDotEmilu()                                           // HttpHandler + Presenter + Verifier
    .AddHandlers(Assembly.GetExecutingAssembly())            // scan handlers
    .AddChainHandlers(Assembly.GetExecutingAssembly())       // scan chain handlers
    .AddValidatorsFromAssembly(Assembly.GetExecutingAssembly()); // FluentValidation validators

Additional documentation

Part of the DotEmilu ecosystem

Package Description
DotEmilu.Abstractions Core interfaces and base classes
DotEmilu Handler pipeline with FluentValidation
DotEmilu.AspNetCore (this) ASP.NET Core Minimal API integration
DotEmilu.EntityFrameworkCore EF Core interceptors and configurations

Feedback

File bugs, feature requests, or questions on GitHub Issues.

Full documentation & source

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.0.0 129 4/3/2026
2.0.3 176 10/19/2025
2.0.2 231 8/21/2025
2.0.1 255 3/31/2025