Daniel Hoelbling-Inzko talks about programming
There are times when your services depend on an object you can’t construct yourself. One obvious example being the HttpContext in most ASP.NET applications.
So all DI containers have some way to inject an instance into the container to cover that. Pandora has joined them yesterday. It’s baked into the fluent interface and the ComponentStore:
Fluent:
var store = new ComponentStore(); var instance = new ClassWithNoDependencies(); store.Register(p => p.Service<IService>("test") .Instance(instance));
Conventional:
var store = new ComponentStore(); var instance = new ClassWithNoDependencies(); store.AddInstance<IService>(instance);