Dependency Injection for DAL with multiple database strings using StructureMap
问题 I have an application that uses Structuremap for DI for both my business and DAL layer. Up to this point, I have had a single DAL per environment that I have been working on. So I would grab it from the config and use that value for all my connections. An example of this is. using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Database"].ToString())) { //Do a call to db here. } I am calling this method using structure map as follows. ObjectFactory.GetInstance