inversion of control - How to use Unity's injectionfactory for child containers in ninject? -


i stuck ninjects equivalent unity registration:

var container = new unitycontainer(); container.registertype<myfactory>(new containercontrolledlifetimemanager());  // resolve instances once per child container myfactory container.registertype<imyinstance>(new hierarchicallifetimemanager(),                                      new injectionfactory(c => c.resolve<myfactory>().getmyinstance())); 

already tried without effect:

var kernel = new standardkernel(); kernel.bind<myfactory>().toself().insingletonscope();  // context preserving should job child containers, right? // thought in call scope ist equivalent unity's hierarchical lifetime manager? kernel.bind<imyinstance>().tomethod(ctx => ctx.contextpreservingget<myfactory>().getmyinstance())                           .incallscope(); 


Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -