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
<PackageReference Include="EllipticBit.Coalescence.AspNetCore" Version="1.5.6" />
<PackageVersion Include="EllipticBit.Coalescence.AspNetCore" Version="1.5.6" />
<PackageReference Include="EllipticBit.Coalescence.AspNetCore" />
paket add EllipticBit.Coalescence.AspNetCore --version 1.5.6
#r "nuget: EllipticBit.Coalescence.AspNetCore, 1.5.6"
#:package EllipticBit.Coalescence.AspNetCore@1.5.6
#addin nuget:?package=EllipticBit.Coalescence.AspNetCore&version=1.5.6
#tool nuget:?package=EllipticBit.Coalescence.AspNetCore&version=1.5.6
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- aControllerBasesubclass with helpers for reading multipart content as serialized objects, text, streams, or byte arrays.CoalescenceExceptionMiddleware- translatesCoalescenceHttpExceptioninstances into structured HTTP responses.AddCoalescenceConstraints()- registers route constraints forbyte,sbyte,short,ushort,uint,ulong,DateTimeOffset, andTimeSpan.ZStdCompressionProvider- a zstdICompressionProviderfor ASP.NET Core response compression.
Requirements
- Targets
.NET 8.0and references theMicrosoft.AspNetCore.Appshared 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);
}
}
Related Packages
| 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:
- Fork the repository and create a feature branch.
- Make your changes, following the existing code style and conventions.
- Add or update tests where appropriate and ensure the solution builds.
- 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 | Versions 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. |
-
net8.0
- EllipticBit.Coalescence.Shared (>= 1.5.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Http (>= 10.0.9)
- System.Collections.Immutable (>= 10.0.9)
- System.Text.Json (>= 10.0.9)
- ZstdSharp.Port (>= 0.8.8)
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 |