It would be great if I could do the following so I can avoid unneccessary closures when the id is dynamic:
string id = "Bar";
Container.Bind<Foo>().WithId(id).AsCached().OnInstantiated((context, obj) => ((Foo)obj).Id = context.BindingId))
In this case context.BindingId == "Bar"
An alternative useful thing for this would be an attribute that can be used for parameter injection, i.e.
Foo([InjectId] string id). This would also be helpful in the create function of factories,
It would be great if I could do the following so I can avoid unneccessary closures when the id is dynamic:
In this case context.BindingId == "Bar"
An alternative useful thing for this would be an attribute that can be used for parameter injection, i.e. Foo([InjectId] string id). This would also be helpful in the create function of factories,