asp.net mvc 2 - Is there End httpRequest event -


i have share objectcontext (from ef4) between many objects, i'm creating 1 context per 1 httprequest (i haven't found better way this), there little problem...

when use

using (objectcontext ctx = new ...) {} 

it disposes context after closing bracket. how should dealt when context lives httprequest? can call event after httprequest ends? or event when response sent?

not disposing context may cause errors in situation when 1 context created per httprequest?

sure, there's endrequest event.

note di frameworks you, automatically. if you'd prefer yourself, can handle event in global.asax.cs.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -