I know that I can specify a constructor to use with the DefaultConstructor attribute. However, I also want to be able to use a different constructor in some instances. Is there any way I can register both constructors with StructureMap, and then choose which one to use when I call ObjectFactory.GetInstance()?
I know that I can specify a constructor to use with the DefaultConstructor attribute.
Share
I do not believe you can do that in StructureMap. Can you pull the separate constructor behaviors you are looking for out into an adapter class. Then your code can take dependencies on the necessary adapter class.