Or is that considered bad practice or something?
I have one notification triggers 4-5 handlers, which in turn call database to retrieve data. Each those calls can also be called separately, so they are request/handler themselves.
Thanks.
Or is that considered bad practice or something?
I have one notification triggers 4-5 handlers, which in turn call database to retrieve data. Each those calls can also be called separately, so they are request/handler themselves.
Thanks.
Jimmy Bogard (the author of mediatr) is saying you should avoid this.
See his blog post
https://lostechies.com/jimmybogard/2016/12/12/dealing-with-duplication-in-mediatr-handlers/
or this stack overflow question and answer https://github.com/jbogard/MediatR/issues/400
Also note that if you are using behaviors they will run multiple times. This could lead to inefficient code but of course it could also be what you want to happen :-)