I have a an ASP.NET MVC 5 app, I am using Structuremap 3 as the IOC.
I have an Interface which is used in multiple types through the N-Tier and I cannot find a succinct explanation of how to to map multiple types to the same interface for automatic constructor injection.
For example I have the following declarations in my registry
For<IDataContextAsync>().Use<DbGeoContext>();
For<IDataContextAsync>().Use<DbEspContext>();
When I run my app I understand the last added instance of IDataContextAsync will be the default instance used when my app creates an instance of a type that needs an IDataContextAsync as a parameter in the constructor.
So my question is how do I tell Structuremap 3 to use a specific instance of IDataContextAsync in the registry relevant to the type being created?
Thanks.