This question is locked. New answers and comments are not allowed.
Referencing this article:
http://www.telerik.com/support/kb/orm/general/best-practices-two.aspx
Can we have an option when generating the ObjectScopeProvider to include this in the generated class?
Possibly then if selected, you can choose the masterpage\page to add in the cleanup...or at least give us the code to copy\paste to save time :)
}
http://www.telerik.com/support/kb/orm/general/best-practices-two.aspx
Can we have an option when generating the ObjectScopeProvider to include this in the generated class?
public static IObjectScope GetPerRequestScope(HttpContext context) |
{ |
string key = HttpContext.Current.GetHashCode().ToString("x") + Thread.CurrentContext.ContextID.ToString(); |
IObjectScope scope; |
if (context == null) |
{ |
scope = ObjectScopeProvider1.GetNewObjectScope(); |
} |
else |
{ |
scope = (IObjectScope)context.Items[key]; |
if (scope == null) |
{ |
scope = ObjectScopeProvider1.GetNewObjectScope(); |
context.Items[key] = scope; |
} |
} |
return scope; |
} |
Possibly then if selected, you can choose the masterpage\page to add in the cleanup...or at least give us the code to copy\paste to save time :)
protected void Page_Unload(object sender, EventArgs e) |
{ |
IObjectScope scope = ObjectScopeProvider1.GetPerRequestScope(HttpContext.Current); |
scope.Dispose(); |