Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Automatic subscription of MessageHandlers #132

Open
marcwittke opened this issue Sep 22, 2021 · 0 comments
Open

Automatic subscription of MessageHandlers #132

marcwittke opened this issue Sep 22, 2021 · 0 comments

Comments

@marcwittke
Copy link
Owner

A lot of boiler plate code needs to be written to handle message subscriptions in the application:

messageBus.Subscribe<StockItemOrderPlacedHandler, StockItemOrderPlaced>();
messageBus.Subscribe<SupplierCreatedHandler, SupplierCreated>();
messageBus.Subscribe<SupplierRenamedHandler, SupplierRenamed>();
messageBus.Subscribe<SupplierDeletedHandler, SupplierDeleted>();
messageBus.Subscribe<SupplierPlacedForDeletionHandler, SupplierPlacedForDeletion>();

This could be automated, due to the fact that these message handlers contain the type of the message to subscribe as generic type parameter.

hovewer, there is the untyped handler, too, only providing the name of the type as string...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant