I would like to be able to inject named dependencies into a class using StructureMap if that is at all possible. The main reason I want this right now is for connection string injection.
I may be doing this the wrong way, but here's how I've got it (just need to add injection now):
psuedo:
public class MyServiceClass
string connectionString;
public MyServiceClass(string connectionString)
this.connectionString = connectionString;
public void DeleteObject
var db = new EntitiesObject(connectionString)
Is there any way to put a name on the connection string constructor parameter so that StructureMap would know how to inject it?
EDIT: I could have multiple connection strings that are determined at run-time from a configuration database.
EDIT: One solution I've thought of is to create a ThisDatabaseConnectionString and a ThatDatabaseConnectionString class... that way it could inject the connection string based on type