EllipticBit.Coalescence.AspNetCore 1.5.6

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

EllipticBit.Coalescence.AspNetCore

ASP.NET Core server-side support library for the Coalescence code generation system.

This package provides the server-side building blocks used by Coalescence-generated ASP.NET Core controllers, including a controller base class with multipart helpers, exception-to-HTTP middleware, additional route constraints for the numeric and date/time types that ASP.NET Core does not support out of the box, and a Zstandard (zstd) response compression provider.

Features

  • CoalescenceControllerBase - a ControllerBase subclass with helpers for reading multipart content as serialized objects, text, streams, or byte arrays.
  • CoalescenceExceptionMiddleware - translates CoalescenceHttpException instances into structured HTTP responses.
  • AddCoalescenceConstraints() - registers route constraints for byte, sbyte, short, ushort, uint, ulong, DateTimeOffset, and TimeSpan.
  • ZStdCompressionProvider - a zstd ICompressionProvider for ASP.NET Core response compression.

Requirements

  • Targets .NET 8.0 and references the Microsoft.AspNetCore.App shared framework.

Installation

Install from NuGet:

dotnet add package EllipticBit.Coalescence.AspNetCore

Or add a PackageReference to your project file (replace the version with the latest published version):

<PackageReference Include="EllipticBit.Coalescence.AspNetCore" Version="x.y.z" />

Getting Started

Register route constraints

Add the Coalescence route constraints to the routing options during application startup:

using EllipticBit.Coalescence.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers();
builder.Services.Configure<RouteOptions>(options =>
{
    options.ConstraintMap.AddCoalescenceConstraints();
});

Register the exception middleware

Add CoalescenceExceptionMiddleware to the request pipeline to convert CoalescenceHttpException instances into HTTP responses:

var app = builder.Build();

app.UseMiddleware<CoalescenceExceptionMiddleware>();
app.MapControllers();

app.Run();

Enable zstd response compression

Register the zstd compression provider with ASP.NET Core response compression:

using EllipticBit.Coalescence.AspNetCore;

builder.Services.AddResponseCompression(options =>
{
    options.Providers.Add<ZStdCompressionProvider>();
});

// ...
app.UseResponseCompression();

Derive a controller from CoalescenceControllerBase

CoalescenceControllerBase is constructed with the registered ICoalescenceSerializer instances and exposes helpers for reading multipart uploads:

using EllipticBit.Coalescence.AspNetCore;
using EllipticBit.Coalescence.Shared;
using Microsoft.AspNetCore.Mvc;

[ApiController]
[Route("api/v1/contacts")]
public class ContactsController : CoalescenceControllerBase
{
    public ContactsController(IEnumerable<ICoalescenceSerializer> serializers)
        : base(serializers)
    {
    }

    [HttpPost("import")]
    public async Task<IActionResult> Import()
    {
        var contact = await MultipartAsSerialized<Contact>("payload");
        return Ok(contact);
    }
}
Package Description
EllipticBit.Coalescence.Shared Shared abstractions (pulled in automatically).
EllipticBit.Coalescence.Request HTTP client transport.
EllipticBit.Coalescence.AspNetCore ASP.NET Core server-side support (this package).
EllipticBit.Coalescence.SignalR SignalR client transport support.

License

Licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository and create a feature branch.
  2. Make your changes, following the existing code style and conventions.
  3. Add or update tests where appropriate and ensure the solution builds.
  4. Open a merge/pull request with a clear description of the change and its motivation.

AI / LLM-assisted contributions

If any part of your contribution was generated with the assistance of a Large Language Model (LLM) or other generative AI tool, you must include the exact prompt(s) used to generate the contribution in the PROMPTS.txt file at the root of the repository. Append each prompt along with a short note describing what it produced. Pull requests containing LLM-generated content without the corresponding prompts will not be accepted.

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 was computed.  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 was computed.  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
1.5.6 104 6/23/2026
1.5.5 119 5/9/2026
1.5.4 256 10/28/2025
1.5.3 239 10/28/2025
1.5.2 273 9/3/2025
1.5.1 266 3/26/2025
1.5.0 299 3/10/2025
1.3.5 256 1/29/2025
1.3.4 235 11/16/2024
1.3.3 242 10/9/2024
1.3.2 237 9/23/2024
1.3.1 237 9/12/2024
1.3.0 251 8/12/2024
1.2.4 239 5/10/2024
1.2.3 225 5/1/2024
1.2.2 248 2/14/2024
1.2.1 272 1/31/2024
1.1.3 239 1/28/2024
1.1.2 239 1/25/2024
1.1.1 239 1/24/2024
Loading failed