You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the IQueryHandler for a GetAllTemplates() but it demands a IQuery Type to be associated with it so that it can be passed to the handle function, but this handler does not need any parameters and I would be creating an empty query type. How do I get around this?
The text was updated successfully, but these errors were encountered:
but this handler does not need any parameters and I would be creating an empty query type. How do I get around this?
You shouldn't go around it. The message type is the identifying part of your use case. Every use case should have a message, even if this means that the message is parameterless. It is not unusual to see query messages without parameters.
Don't forget the message isn't really 'empty', it already contains 2 essential pieces of information:
The name of the use case. This allows the message to be routed to the right handler.
The return type. This allows type safety, allows applying cross-cutting concerns, allows analysing this information in an automated fashion, and communicates to consumers what data they should expect.
Don't be worried about this and don't try to optimize this. This typically only leads to more pain than that it fixes. Again: you are defining your use cases with types. You effectively apply type based programming.
Hi,
I want to use the IQueryHandler for a GetAllTemplates() but it demands a IQuery Type to be associated with it so that it can be passed to the handle function, but this handler does not need any parameters and I would be creating an empty query type. How do I get around this?
The text was updated successfully, but these errors were encountered: