How can I figure StructureMap to use more than one concrete Class per Interface. i.e. an IRepositoryCustomer is implemented by: RepositoryCustomerA and RepositoryCustomerB
How do I register and resolve this to/from the StructureMap IoC container?
How can I figure StructureMap to use more than one concrete Class per Interface. i.e. an IRepositoryCustomer is implemented by: RepositoryCustomerA and RepositoryCustomerB
How do I register and resolve this to/from the StructureMap IoC container?
You first need to answer the question, "when do I want RepositoryCustomerA instead of RepositoryCustomerB?"
If either of those classes could be instantiated in production based on some runtime state, then you probably want to look into conditional object construction.
If RepositoryCustomerA should be instantiated at development time (for unit testing, say) while RepositoryCustomerB is the production analog, then you need two distinct Registry
s: one that exists only in your test code, and one that is accessible in production. For more on this route, read about creating registries as a means of configuring StructureMap.