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
Post a Comment