c# - How to release and dispose all Http-scoped objects on Container instance? -


in structuremap, how can release , dispose al http-scoped objects on specific container instance? default intance in object factory, can execute method releaseanddisposeallhttpscopedobjects(), container class , icontainer interface doesn't seem have such method.

if @ internals of objectfactory.releaseanddisposeallhttpscopedobjects, can see conveniency method implemented this:

public static void releaseanddisposeallhttpscopedobjects() {     httpcontextlifecycle.disposeandclearall(); } 

ie. can invoke httpcontextlifecycle.disposeandclearall method clear objects.

edit: since httpcontextlifecycle global , not per container, think nested container approach solution gain more fine grained control on object lifetime during http request.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -