rebus-org / Rebus.ServiceProvider

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

Forward all singletons to Rebus service #71

Closed mattwcole closed 2 years ago

mattwcole commented 2 years ago

This change fixes an edge case when supplying forwardedSingletonTypes to HostBuilderExtensions.AddRebusService(). The forwarded type may be an interface with multiple implementations registered, in which case all of the implementations should be forwarded.

There is a slight change in behavior; where hostProvider.GetRequiredService(forwardedType) would previously throw if the type was not registered, hostProvider.GetServices(forwardedType) will simply return an empty collection.


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 2 years ago

CLA assistant check
All committers have signed the CLA.

mookid8000 commented 2 years ago

👍

mookid8000 commented 2 years ago

Excellent! It's on NuGet.org as Rebus.ServiceProvider 8.3.1 now 🙂