rebus-org / Rebus.ServiceProvider

:bus: Microsoft Extensions Dependency Injection container adapter for Rebus
https://mookid.dk/category/rebus
Other
65 stars 32 forks source link

Implement auto-registration methods that allow filtering by namespace. #80

Closed JeremySkinner closed 1 year ago

JeremySkinner commented 1 year ago

The Rebus.Autofac package has methods that allow auto-registration for handlers filtered by namespace. This PR brings equivalent functionality to Rebus.ServiceProvider by adding 2 new methods:

services.AutoRegisterHandlersFromAssemblyNamespaceOf<MyHandler>();
services.AutoRegisterHandlersFromAssemblyNamespaceOf(typeof(MyHandler));

This is useful as you can use namespaces to scope handlers for a specific queue.

Please let me know if you'd like me to amend anything.


Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

mookid8000 commented 1 year ago

Nice addition! - thanks for contributing 🙂 it's out as Rebus.ServiceProvider 10.0.0-alpha04 on NuGet.org now.