I need help with this. I\'m using Unity as my container and I want to inject two different instances of the same type into my constructor.
class Example
{
Well, don't
You should use the factory pattern in this case.
class Example
{
Example(IQueueFactory factory)
{
_sendQueue = factory.Create("MySend");
_receiveQueue = factory.Create("MyReceive");
}
}
It makes the intention a lot more clear and you can internally in the Example
class handle if the queues are not found or incorrectly configured.