Mediator.Net | simple mediator for .Net for sending command | Microservice library
kandi X-RAY | Mediator.Net Summary
kandi X-RAY | Mediator.Net Summary
A mediator project for .NET.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Mediator.Net
Mediator.Net Key Features
Mediator.Net Examples and Code Snippets
Community Discussions
Trending Discussions on Mediator.Net
QUESTION
can mediator.net support multi event handlers? i want to have multiple handlers listen to the same event and do different thing.
...ANSWER
Answered 2017-May-15 at 03:39In Mediator.Net, you can have as many event handlers as you want as long as the message implement the IEvent interface, but only 1 command handler. From your code example, as SimpleCommand is a ICommand which mean that you can only have one handler for it.
In terms of inheritance, ICommand handler need to be the exact type which mean no inheritance is supported. For IEvent, as long as the Handler is assignable from the message type then it should get called, so inheritace is in.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Mediator.Net
The most powerful thing for the pipelines above is you can add as many middlewares as you want. Follow the following steps to setup a middlewaree. You might need some dependencies in your middleware, there are two ways to do it. Here is a sample middleware.
Add a static class for your middleware
Add a public static extension method in that class you just added, usually follow the UseXxxx naming convention
Add another class for your middleware's specification, note that this is the implementation of your middleware
Pass them in explicitly
Let the IoC container to resolve it for you (if you are using IoC)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page