Slck.Envelope
1.1.0
dotnet add package Slck.Envelope --version 1.1.0
NuGet\Install-Package Slck.Envelope -Version 1.1.0
<PackageReference Include="Slck.Envelope" Version="1.1.0" />
<PackageVersion Include="Slck.Envelope" Version="1.1.0" />
<PackageReference Include="Slck.Envelope" />
paket add Slck.Envelope --version 1.1.0
#r "nuget: Slck.Envelope, 1.1.0"
#:package Slck.Envelope@1.1.0
#addin nuget:?package=Slck.Envelope&version=1.1.0
#tool nuget:?package=Slck.Envelope&version=1.1.0
🔦 Slck.Envelope
Slck.Envelope is a lightweight, opinionated library for ASP.NET Core minimal APIs that standardizes API responses into a consistent envelope format. It provides a structured way to handle success responses, errors, and metadata across your entire API.
✨ Features
Consistent Response Shape: Every endpoint returns
ApiResponse<T>with standardized properties:success: Boolean indicating request statusdata: The response payload (null on error)error: Error details (null on success)meta: Optional metadata (pagination, timestamps, etc.)
Minimal API Integration: Seamless integration with ASP.NET Core minimal APIs using
IResultimplementations:Envelope.Ok(data, message): 200 OK responsesEnvelope.Created(data, uri): 201 Created responsesEnvelope.NotFound(message): 404 Not Found responsesEnvelope.BadRequest(message, errors): 400 Bad Request with validation errorsEnvelope.Unauthorized(message): 401 Unauthorized responsesEnvelope.InternalServerError(message): 500 Internal Server Error
Exception Handling Middleware: Automatic wrapping of unhandled exceptions into standardized error envelopes.
Pagination Support: Built-in
PaginationMetafor paginated list endpoints with:- Page number
- Page size
- Total items
- Total pages
- Navigation links
Developer Experience:
- CamelCase JSON serialization
- Ignore null properties
- Extension methods for common scenarios
- Type-safe response factories
📦 Installation
Install via NuGet Package Manager:
dotnet add package Slck.Envelope
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.