Toolsfactory.Common.Mediator
0.2.2
dotnet add package Toolsfactory.Common.Mediator --version 0.2.2
NuGet\Install-Package Toolsfactory.Common.Mediator -Version 0.2.2
<PackageReference Include="Toolsfactory.Common.Mediator" Version="0.2.2" />
<PackageVersion Include="Toolsfactory.Common.Mediator" Version="0.2.2" />
<PackageReference Include="Toolsfactory.Common.Mediator" />
paket add Toolsfactory.Common.Mediator --version 0.2.2
#r "nuget: Toolsfactory.Common.Mediator, 0.2.2"
#addin nuget:?package=Toolsfactory.Common.Mediator&version=0.2.2
#tool nuget:?package=Toolsfactory.Common.Mediator&version=0.2.2
Toolsfactory.Common Mediator Implementation
The Toolsfactory.Common.Mediator
library implements the Mediator pattern to decouple the sender and receiver of requests. It provides a centralized mechanism for handling commands, queries, and notifications in a clean and extensible way.
Key Features
- Command Handling: Send commands with or without return values to their respective handlers.
- Query Handling: Execute queries and retrieve results from their handlers.
- Notification Publishing: Publish notifications to all registered handlers.
- Pipeline Behaviors: Add custom behaviors (e.g., logging, validation, or caching) around request processing.
- Zero-Allocation Logging: Efficient logging using source generators for better performance.
Usage
Register the Mediator: Use the
AddMediator
extension method to register the Mediator and all handlers in your dependency injection container.Send Commands and Queries: Use the
IMediator
interface to send commands or queries.Publish Notifications: Publish notifications to all registered handlers.
Benefits
- Decoupled Architecture: Simplifies communication between components by removing direct dependencies.
- Extensibility: Easily add custom behaviors using pipeline extensions.
- Performance: Optimized for high-performance scenarios with zero-allocation logging and caching.
This library is designed for modern .NET applications targeting .NET 9
and leverages advanced features like dependency injection & logging.
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
- Microsoft.Extensions.DependencyInjection (>= 9.0.4)
- Microsoft.Extensions.Logging (>= 9.0.4)
- Toolsfactory.Common.Mediator.Abstractions (>= 0.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.