CSharpEssentials.AspNetCore 3.0.4

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

CSharpEssentials.AspNetCore

Production-ready ASP.NET Core utilities: global exception handling, structured ProblemDetails, API versioning, Swagger setup, and Result endpoint filters.

Features

  • Global Exception Handler — Converts DomainException, EnhancedValidationException, and others into RFC 7807 ProblemDetails.
  • Enhanced Problem Details — Extend ProblemDetails with structured error codes and messages.
  • Result Endpoint Filter — Automatically convert Result<T> return values to 200 OK or 400 BadRequest.
  • API Versioning — Pre-configured URL segment and header-based versioning.
  • Swagger — Easy setup with versioning support, enum schema filters, and custom schema IDs.

Installation

dotnet add package CSharpEssentials.AspNetCore

Usage

Global Exception Handling

builder.Services.AddProblemDetails();
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();

var app = builder.Build();
app.UseExceptionHandler();

API Versioning

builder.Services.AddAndConfigureApiVersioning();

var app = builder.Build();
var usersGroup = app.CreateVersionedGroup("users", version: 1);
usersGroup.MapGet("/{id}", (int id) => Results.Ok(new { Id = id }));

Swagger with Versioning

builder.Services.AddSwagger<ConfigureSwaggerOptions>(securityScheme: SecuritySchemes.Bearer);

var app = builder.Build();
app.UseVersionableSwagger();

Result Endpoint Filter

builder.Services.AddScoped<ResultEndpointFilter>();

app.MapGet("/users/{id}", (int id) => GetUser(id))
   .AddEndpointFilter<ResultEndpointFilter>();

// Returns 200 with value on success, 400 with errors on failure

Structured Error Response

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Bad Request",
  "status": 400,
  "errors": [
    { "code": "User.InvalidEmail", "description": "Email format is incorrect.", "type": "Validation" }
  ]
}
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.  net11.0 is compatible. 
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
3.0.4 0 5/6/2026
3.0.3 3 5/5/2026
3.0.2 60 5/5/2026
3.0.1 78 5/3/2026
3.0.0 79 5/3/2026
2.1.0 222 11/26/2025
2.0.9 228 9/30/2025
2.0.8 214 9/29/2025
2.0.7 198 9/29/2025
2.0.6 207 9/29/2025
2.0.5 209 9/29/2025
2.0.4 220 9/28/2025
2.0.3 209 9/28/2025
2.0.2 204 9/28/2025
2.0.1 203 9/28/2025
2.0.0 209 9/28/2025
1.0.15 492 2/4/2025
1.0.14 388 1/29/2025
1.0.13 201 12/27/2024
1.0.12 184 12/18/2024
Loading failed