asp.net web api - What's the equivalent of CastleWindsor's container.Release in LightInject? -


i saw asp.net web api dependency injection in seemann's site. uses castlewindsor though.

request.registerfordispose(             new release(                 () => this.container.release(controller))); 

what's equivalent of castlewindsor's container.release in lightinject?

http://blog.ploeh.dk/2012/10/03/dependencyinjectioninasp.netwebapiwithcastlewindsor/

there not release method in lightinject. disposable services registered either perscopelifetime og perrequestlifetime.

these services disposed when surrounding scope disposed.

container.register<ifoo, disposablefoo>(new perscopelifetime())  using(container.beginscope()) {     var foo = container.getinstance<ifoo>() } -- foo disposed here 

lightinject.webapi provides integration web api takes care of disposing controllers when web request ends.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -