-2

I have a "big" project with lots of commands/requests.

Then I have a couple of API projects that expose a section of these commands trough some end points and I'm using mediator to inspect the "big" assembly in order to know hot to deal with them.

But some of them are not necessary for a couple of projects and are more painful to set up.

Is there a way to signal them to be ignored as they are not used?

RagnaRock
  • 2,432
  • 7
  • 34
  • 56
  • Hard to tell without knowing anything about the structure of your project. (Outside that you are using MediatR) – Fildor Aug 10 '23 at 14:48
  • I've updated the description a little bit, does it help? – RagnaRock Aug 10 '23 at 14:54
  • I don't know, but that sounds to me like you'd be better off to split that "big" project up into reasonable peaces, so you can add only the Request/Handlers that are needed. – Fildor Aug 10 '23 at 15:03
  • Probably... As an alternative, can I add individual classes instead of the entire assembly ? – RagnaRock Aug 10 '23 at 18:13

1 Answers1

0

I still don't have very much information, but it really sounds like you have an architectural issue, not a coding one. If you are calling MediatR, you should want to call MediatR and have it handled. If you don't, a different solution to that given task is most likely needed.

To be clear, MediatR is akin to the glue that connects two layers of an application. As its name implies, it is a mediator. It shouldn't have business logic dictating how and when it should be called, that logic should exist outside of the MediatR request.

Jeff B
  • 975
  • 8
  • 25