Caravel.AspNetCore
0.25.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Caravel.AspNetCore --version 0.25.0
NuGet\Install-Package Caravel.AspNetCore -Version 0.25.0
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="Caravel.AspNetCore" Version="0.25.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Caravel.AspNetCore" Version="0.25.0" />
<PackageReference Include="Caravel.AspNetCore" />
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 Caravel.AspNetCore --version 0.25.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Caravel.AspNetCore, 0.25.0"
#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 Caravel.AspNetCore@0.25.0
#: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=Caravel.AspNetCore&version=0.25.0
#tool nuget:?package=Caravel.AspNetCore&version=0.25.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Caravel.AspNetCore
This package contains reusable middleware, http utilities that every application needs.
- Exception Middleware
// Handle exceptions according to RFC: https://tools.ietf.org/html/rfc7807
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
{
"code": "book_not_found",
"title": "Book does not exist",
"status": 404,
"detail": "Book 53655b3d-48d5-4ac1-ba73-4318b3b702e8 does not exist",
}
- Endpoint Features
Add all endpoints features that implement IEndpointFeature interface.
builder.Services.AddEndpointFeatures(Assembly.GetExecutingAssembly());
Map feature endpoints.
ApiVersionSet apiVersionSet = app.NewApiVersionSet()
.HasApiVersion(new ApiVersion(1))
.ReportApiVersions()
.Build();
RouteGroupBuilder versionedGroup = app
.MapGroup("api/v{version:apiVersion}")
.WithApiVersionSet(apiVersionSet);
app.MapEndpointFeatures(versionedGroup);
- User Context Implementation using
HttpContextAccessor
// Requirement since it's injected in the UserContext implementation
services.AddHttpContextAccessor();
services.AddScoped<IUserContext, UserContext>();
// Inject IUserContext in your services
public MyService(IUserContext userContext)
{
var userId = userContext.UserId();
}
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Asp.Versioning.Http (>= 8.1.0)
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- Caravel (>= 0.26.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.8)
- Microsoft.AspNetCore.OpenApi (>= 8.0.8)
- Microsoft.IdentityModel.Tokens (>= 8.0.1)
- Swashbuckle.AspNetCore (>= 6.7.1)
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 |
|---|---|---|
| 0.33.0 | 333 | 12/6/2024 |
| 0.32.0 | 253 | 10/12/2024 |
| 0.31.0 | 124 | 10/12/2024 |
| 0.30.0 | 120 | 10/12/2024 |
| 0.29.0 | 145 | 10/2/2024 |
| 0.28.0 | 134 | 10/2/2024 |
| 0.27.0 | 142 | 9/29/2024 |
| 0.26.0 | 106 | 9/28/2024 |
| 0.25.0 | 111 | 9/28/2024 |
| 0.24.0 | 143 | 8/20/2024 |
| 0.23.0 | 252 | 12/10/2023 |
| 0.20.0 | 500 | 9/24/2022 |
| 0.19.0 | 184 | 9/24/2022 |
| 0.17.0 | 289 | 9/27/2021 |
| 0.16.0 | 440 | 4/10/2021 |
| 0.15.1 | 471 | 1/23/2021 |
| 0.15.0 | 452 | 11/21/2020 |
| 0.14.0 | 535 | 11/15/2020 |
| 0.13.0 | 501 | 10/27/2020 |
| 0.12.1 | 493 | 10/14/2020 |
| 0.12.0 | 527 | 10/14/2020 |
| 0.11.1 | 554 | 10/12/2020 |
| 0.11.0 | 530 | 10/12/2020 |
| 0.10.0 | 579 | 9/10/2020 |
| 0.9.1 | 513 | 9/5/2020 |
| 0.9.0 | 522 | 9/5/2020 |
| 0.8.0 | 663 | 5/29/2020 |
| 0.7.0 | 554 | 5/16/2020 |
| 0.5.0 | 572 | 4/11/2020 |
| 0.4.2 | 569 | 4/11/2020 |
| 0.4.1 | 603 | 4/10/2020 |
| 0.4.0 | 744 | 1/27/2020 |
| 0.3.2 | 870 | 1/11/2020 |
| 0.3.1 | 600 | 1/11/2020 |
| 0.3.0 | 587 | 1/11/2020 |
| 0.2.2 | 678 | 1/4/2020 |
| 0.2.1 | 628 | 12/26/2019 |
| 0.2.0 | 626 | 12/26/2019 |