Structure map (2.6).
I have some classes and a registry that look like the following:
public interface IManyType {}
public class ManyType1 : IManyType {}
public class ManyType2 : IManyType {}
public class ManyType3 : IManyType {}
public class TestRegistry : Registry
{
public TestRegistry()
{
For<IManyType>().Add<ManyType1>();
For<IManyType>().Add<ManyType2>();
Profile("Profile1").For<IManyType>().Use<ManyType1>();
Profile("Profile1").For<IManyType>().Use<ManyType2>();
Profile("Profile1").For<IManyType>().Use<ManyType3>();
}
}
What I've found is that whether or not I've set the profile on ObjectFactory, SM will return all three instances. If it's not clear, what I'm after is registering a different set of instances for a given type using profiles.
Am I doing something wrong?
-Joe