Kododo.Reiho.AspNetCore 2.1.1

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

Reiho.AspNetCore

Lightweight request/handler abstraction for ASP.NET Core Minimal APIs, plus a helper for serving embedded SPAs.

Install

dotnet add package Kododo.Reiho.AspNetCore

Request / Handler

// Define
public sealed record GetUser(int Id) : IRequest<UserDto>;

// Handle
public sealed class GetUserHandler : IRequestHandler<GetUser, UserDto>
{
    public Task<UserDto> HandleAsync(GetUser request, CancellationToken ct)
        => Task.FromResult(new UserDto { Id = request.Id });
}

// Register & map
builder.Services.AddRequestHandlers(typeof(Program).Assembly);
app.MapGroup("/api").MapRequests(typeof(Program).Assembly);
// → POST /api/GetUser

Requests without a return value use IRequest / IRequestHandler<T> and return 204 No Content.

Validation and errors

Data annotations on the request, also on positional record parameters and in nested objects, are checked before the handler runs, and so are non-nullable references and unknown fields; a request that fails gets 400 with the errors per field as problem details (RFC 9457). A handler ends a request with an error the caller can act on by throwing RequestException:

public sealed record CreateUser([Required, StringLength(50)] string Name) : IRequest<UserDto>;

throw RequestException.NotFound($"User {request.Id} does not exist.");       // 404
throw RequestException.Invalid(nameof(request.Name), "The name is taken.");   // 400, errors.name

Conflict (409) and Forbidden (403) work the same way. With AddProblemDetails(), problems go through the app's IProblemDetailsService.

Attributes

Attributes on the request apply to its endpoint, as on a controller action, e.g. [Authorize(Roles = "Admin")], [AllowAnonymous] or [EnableRateLimiting].

Files

IFormFile properties make a request take multipart/form-data, with an antiforgery token required as for minimal API forms ([RequireAntiforgeryToken(false)] opts out). A handler returns a file with FileResponse:

public sealed record UploadAvatar(int UserId) : IRequest { [Required] public IFormFile? Avatar { get; init; } }
public sealed record ExportOrders : IRequest<FileResponse>;

return FileResponse.FromText(csv, "text/csv", "orders.csv");

Request filters

IRequestFilter runs around every handler, over HTTP and MCP, once the request is validated, and sees the request object:

builder.Services.AddRequestFilter<AuditFilter>();

OpenAPI

Endpoints describe themselves for ApiExplorer, so Microsoft.AspNetCore.OpenApi, Swashbuckle and Scalar document them: request body, result type, problem responses, the request's [Description] as summary, and an operation id from the full route (/api/GetUser → Api_GetUser).

MCP

Kododo.Reiho.AspNetCore.Mcp offers requests as tools to AI agents.

Embedded SPA

Serve a bundled SPA from embedded resources with automatic base path injection:

app.MapGroup("/ui")
   .RequireAuthorization()
   .MapEmbeddedSpa(Assembly.GetExecutingAssembly(), "Frontend/dist");

Add to your .csproj:

<PropertyGroup>
  <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>

<ItemGroup>
  <EmbeddedResource Include="Frontend\dist\**\*" />
  <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.12" />
</ItemGroup>

Microsoft.Extensions.FileProviders.Embedded provides the build task that writes the manifest. Use a 10.x version on every target framework, net8.0 and net9.0 included. The .NET 10 SDK prunes 8.x and 9.x as part of the shared framework, which drops the task, so the manifest is missing and MapEmbeddedSpa fails at startup.

Place __BASE_PATH__ in your index.html — replaced at runtime with the actual mount path. rootPath defaults to "SPA/dist".

When running behind a reverse proxy that strips a path prefix (e.g. Caddy's handle_path), set ASPNETCORE_PATHBASE to that prefix; the MapGroup path is added to it:

ASPNETCORE_PATHBASE=/configway/demo

If the app also calls app.UsePathBase(app.Configuration["PathBase"]), the prefix is not added twice.

To put more per-request values into index.html (settings, an import map, a CSP nonce), add placeholders. Each is replaced after the base path, as is, so encode the value for where it lands:

app.MapGroup("/ui").MapEmbeddedSpa(Assembly.GetExecutingAssembly(), o =>
{
    o.RootPath = "Frontend/dist";
    o.Placeholder("__NONCE__", ctx => ctx.Items["csp-nonce"] as string ?? "");
});
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Kododo.Reiho.AspNetCore:

Package Downloads
Kododo.ConfigWay.UI

Embedded web UI for ConfigWay. Adds a React-based editor served directly from the host application, in Way.Shell — no separate deployment required.

Kododo.Way.Shell

Shared UI shell for Kododo Way libraries (ConfigWay, CultureWay, RunWay, LogWay): one layout, theme, language and React for every Way in an app, and an optional panel with all of them.

Kododo.CultureWay.UI

Embedded web UI for CultureWay. Adds a React-based localization editor served directly from the host application, so no separate deployment is needed.

Kododo.RunWay.Dashboard

Embedded web dashboard for RunWay. Inspect job statuses, audit timelines, and runner health directly from your ASP.NET Core application.

Kododo.Reiho.AspNetCore.Mcp

Offers Reiho requests as tools to AI agents over the Model Context Protocol.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.1 489 10/16/2026
2.1.0 120 10/16/2026
2.0.0 147 10/14/2026
1.0.1 119 10/12/2026
1.0.0 521 5/6/2026
1.0.0-alpha.4 85 4/30/2026
1.0.0-alpha.3 82 4/30/2026
1.0.0-alpha.1 95 4/29/2026
0.0.10 157 4/17/2026
0.0.9 126 4/16/2026
0.0.8 133 4/16/2026
0.0.7 152 4/11/2026
0.0.4 135 4/10/2026
0.0.3 131 3/17/2026
0.0.2 132 3/17/2026
0.0.1 137 3/12/2026