jbogard / MediatR

Simple, unambitious mediator implementation in .NET
Apache License 2.0
10.91k stars 1.16k forks source link

Is there a way to use MediatR with pure JSON string based on a property name? #953

Closed george-weare8 closed 11 months ago

george-weare8 commented 11 months ago

Having the below JSON.

{
   "eventName": "userCreated",
   "someKey": "someValue"
}

Use MediatR to send this JSON to a RequestHandler based on eventName?

jbogard commented 11 months ago

No. Before you call MediatR convert that to an event object then call Publish.

george-weare8 commented 11 months ago

I thought so this is the way to go, thanks.