I have a scenario in which I need to be able to get two different implementations of an interface IObjectContext from StructureMap. I know that using a named instance is the answer but I'm having trouble with the DSL for this because the class to "use" is also the same in each case, but with a different constructor parameter.
So, the way to create these objects outside of StructureMap are as follows:
IObjectContext context1 = new ObjectContextAdapter(new Model1Entities());
IObjectContext context2 = new ObjectContextAdapter(new Model2Entities());
How can I express this configuration in StructureMap Registry DSL? I know that I need to use named instances but I can't get my head around the rest of the syntax.
Thanks!!!