Injecting correct object graph using StructureMap in Queue of different Objects
- by davy
I have a queuing service that has to inject a different dependency graph depending on the type of object in the queue. I'm using Structure Map.
So, if the object in the queue is TypeA the concrete classes for TypeA are used and if it's TypeB, the concrete classes for TypeB are used.
I'd like to avoid code in the queue like:
if (typeA)
{
//…