Caravel.MediatR 0.17.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Caravel.MediatR --version 0.17.0
                    
NuGet\Install-Package Caravel.MediatR -Version 0.17.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.MediatR" Version="0.17.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Caravel.MediatR" Version="0.17.0" />
                    
Directory.Packages.props
<PackageReference Include="Caravel.MediatR" />
                    
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 Caravel.MediatR --version 0.17.0
                    
#r "nuget: Caravel.MediatR, 0.17.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.MediatR@0.17.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.MediatR&version=0.17.0
                    
Install as a Cake Addin
#tool nuget:?package=Caravel.MediatR&version=0.17.0
                    
Install as a Cake Tool

Caravel.MediatR

This package contains reusable MediatR behaviours.

Logging Behaviour

Creates an entry Log for the start and failure of each request in the pipeline. It will log the error in case the request fails.

builder.Services.AddMediatR(cfg =>
{
    cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
    cfg.AddOpenBehavior(typeof(LoggingRequestBehaviour<,>));
});

Validation and ResultValidation Behaviour

Validates requests using FluentValidation. It is recommended to use ResultValidationRequestBehaviour when using the Result pattern to avoid throwing unnecessary ValidationException.

builder.Services.AddMediatR(cfg =>
{
    cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
    cfg.AddOpenBehavior(typeof(ValidationRequestBehaviour<,>));
    cfg.AddOpenBehavior(typeof(ResultValidationRequestBehaviour<,>));
});
{
  "code": "invalid_fields",
  "title": "Invalid Fields",
  "status": 400,
  "errors": {
    "field1": ["error_1", "error_2"]
  }
}

Idempotent Behaviour

Ensures all requests implementing interface IIdempotentRequest are idempotent.

builder.Services.AddMediatR(cfg =>
{
    cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
    cfg.AddOpenBehavior(typeof(IdempotentRequestBehaviour<,>));
});
{
  "code": "duplicate_request",
  "title": "Duplicate request",
  "status": 204,
  "detail": "Duplicate request with Idempotent Key 53655b3d-48d5-4ac1-ba73-4318b3b702e8."
}
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
0.21.0 333 12/6/2024
0.20.0 249 10/12/2024
0.19.0 162 10/2/2024
0.18.0 132 9/29/2024
0.17.0 109 9/28/2024
0.16.0 132 8/20/2024
0.14.0 245 12/10/2023
0.13.0 147 12/4/2023
0.12.0 432 10/2/2022
0.11.0 466 9/24/2022
0.10.0 178 9/24/2022
0.8.0 264 9/30/2021
0.7.0 257 9/27/2021
0.6.0 421 4/10/2021
0.5.0 470 11/21/2020
0.4.0 494 11/15/2020
0.3.0 476 10/27/2020
0.2.0 529 10/12/2020
0.1.1 489 9/5/2020
0.1.0 528 9/5/2020