pardahlman / RawRabbit

A modern .NET framework for communication over RabbitMq
MIT License
747 stars 144 forks source link

Using the AddRawRabbit Extension should not overwrite registrations #241

Closed JoeStead closed 7 years ago

JoeStead commented 7 years ago

When using the AddRawRabbit ServiceCollection extension method, it currently overwrites any existing registrations.

Instead of overwriting existing registrations, it should only register the type if one does not already exist.

pardahlman commented 7 years ago

Top of the evening, @JoeStead 👋 Thanks for reporting this!

I have to make some assumptions, as it is not 100% clear to me what your setup is like.

The last thing that happens before returning the IServiceCollection is that the custom delegate/action is called. This ensures that whatever custom configuration that is provided in the AddRawRabbit call is registered last.

Let me know if any of my assumptions are wrong and feel free to post a snippet of how you register RawRabbit and how I can reproduce it.

Take care!

pardahlman commented 7 years ago

Hello again, @JoeStead - I haven't heard from you in a while, so closing this issue for now. Feel free to re-open if you have any more input on the topic!