I am trying to use StructureMap and have essentially 3 levels of abstraction. I have a service a repository and database interface. So the IService depends on IRepo and IRepo depends on IDatabase. My issue is that my IDatabase concrete type takes in db connection information. I am going to create these on the fly, trying to use ObjectFactory.Configure().
So I have a user and the user is linked to a company and the I lookup the company connection information and I want to create the proper IDatabase concrete type based on this information. I have the concrete type configured in my startup code. I only want to use the IService object from outside...so I want to create a named IService object named with the company Name. Having issues with trying to create these types on the fly. ANY information would be helpfull...
I basically want to be able to create a named instance and either set properties or pass specific args to a constructor at runtime, without knowing the concrete type. I have the concrete type setup in the config file. I have tried to use the ObjectFactory.GetInstance and tried to set properties inside the Configure method, but got StackOverflow exception...HOW IRONIC