Enigmatry.Entry.MediatR 9.1.1-preview.3

This is a prerelease version of Enigmatry.Entry.MediatR.
dotnet add package Enigmatry.Entry.MediatR --version 9.1.1-preview.3
                    
NuGet\Install-Package Enigmatry.Entry.MediatR -Version 9.1.1-preview.3
                    
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="Enigmatry.Entry.MediatR" Version="9.1.1-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Enigmatry.Entry.MediatR" Version="9.1.1-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="Enigmatry.Entry.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 Enigmatry.Entry.MediatR --version 9.1.1-preview.3
                    
#r "nuget: Enigmatry.Entry.MediatR, 9.1.1-preview.3"
                    
#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.
#addin nuget:?package=Enigmatry.Entry.MediatR&version=9.1.1-preview.3&prerelease
                    
Install Enigmatry.Entry.MediatR as a Cake Addin
#tool nuget:?package=Enigmatry.Entry.MediatR&version=9.1.1-preview.3&prerelease
                    
Install Enigmatry.Entry.MediatR as a Cake Tool

MediatR Extensions

A library that provides extensions and utilities for working with MediatR, enhancing the mediator pattern implementation with additional features.

Intended Usage

Use this library when you want to extend MediatR with additional behaviors, such as validation, logging, performance monitoring, or transactional support.

Installation

Add the package to your project:

dotnet add package Enigmatry.Entry.MediatR

Usage Example

using Enigmatry.Entry.MediatR;
using MediatR;

// Creating a command with validation
public class CreateUserCommand : IRequest<int>, IValidatable
{
    public string Username { get; set; }
    public string Email { get; set; }
    
    public ValidationResult Validate()
    {
        var result = new ValidationResult();
        
        if (string.IsNullOrEmpty(Username))
            result.AddError("Username is required");
            
        if (string.IsNullOrEmpty(Email) || !Email.Contains("@"))
            result.AddError("Valid email is required");
            
        return result;
    }
}

// Command handler
public class CreateUserCommandHandler : IRequestHandler<CreateUserCommand, int>
{
    public async Task<int> Handle(CreateUserCommand request, CancellationToken cancellationToken)
    {
        // Implementation
        return userId;
    }
}

Dependency Injection Example

Register MediatR with the extension behaviors:

using Enigmatry.Entry.MediatR;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Add MediatR
        services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Startup).Assembly));
        
        // Add validation behavior
        services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
        
        // Add logging behavior
        services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
    }
}
Product 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. 
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
9.1.1-preview.3 108 6/4/2025
9.1.0 197 6/3/2025
9.0.1-preview.8 114 5/26/2025
9.0.1-preview.7 201 5/13/2025
9.0.1-preview.6 159 5/9/2025
9.0.1-preview.5 145 5/7/2025
9.0.1-preview.4 112 4/30/2025
9.0.1-preview.2 119 4/1/2025
9.0.0 825 2/26/2025
8.1.1-preview.3 113 5/7/2025
8.1.1-preview.1 120 4/1/2025
8.1.0 579 2/19/2025
8.0.1-preview.4 67 2/7/2025
8.0.1-preview.2 49 1/15/2025
8.0.0 1,167 11/27/2024
3.4.6-preview.10 59 11/27/2024
3.4.3 1,954 10/22/2024
3.4.2 701 10/11/2024
3.4.1 129 10/9/2024
3.4.0 129 10/9/2024
3.3.2 477 8/28/2024
3.3.2-preview.7 86 8/27/2024
3.3.1 433 7/16/2024
3.3.1-preview.4 68 7/12/2024
3.3.0 1,104 6/20/2024
3.2.1-preview.4 66 6/17/2024
3.2.1-preview.1 79 5/23/2024
3.2.0 4,288 4/3/2024
3.1.1-preview.1 1,020 3/13/2024
3.1.0 342 3/8/2024
3.1.0-preview.2 427 2/19/2024
3.0.1-preview.2 1,131 2/9/2024
3.0.1-preview.1 85 1/24/2024
3.0.0 1,339 1/15/2024
3.0.0-preview.14 119 1/9/2024
3.0.0-preview.12 68 1/9/2024
3.0.0-preview.5 68 1/10/2024
3.0.0-preview.2 143 12/28/2023
3.0.0-preview 152 12/20/2023
2.1.0 189 12/28/2023
2.0.1-preview.3 119 12/1/2023
2.0.1-preview.2 91 11/29/2023
2.0.1-preview.1 85 11/28/2023
2.0.0 487 11/8/2023
2.0.0-preview.3 463 10/27/2023
2.0.0-preview.2 83 10/27/2023
2.0.0-preview.1 91 10/27/2023
2.0.0-preview 145 10/27/2023
1.1.500 171 10/27/2023
1.1.495 201 9/24/2023
1.1.486 488 9/13/2023
1.1.484 220 9/7/2023
1.1.482 202 9/6/2023
1.1.480 328 8/24/2023
1.1.477 481 8/2/2023
1.1.464 225 7/5/2023
1.1.447 866 5/26/2023
1.1.396 293 4/11/2023
1.1.383 296 4/3/2023
1.1.377 256 3/13/2023
1.1.376 277 3/13/2023
1.1.365 999 2/15/2023