I\'ve literally just started using the Unity Application Blocks Dependency Injection library from Microsoft, and I\'ve come unstuck.
This is my IoC class that\'ll ha
I ll add another way :)
You can use Injection parameters that get passed into the constructor when you register a type. This way you can still use constructor injection.
class Repository : IRepository {
readonly string m_ConnectionString;
public Repository(string connectionString) {
ConnectionString = connectionString;
}
}
//When registering
container.RegisterType(new InjectionConstructor("connectionstring"));