This question is locked. New answers and comments are not allowed.
I have a list of object that I read them from database using ORM
when repeater try to read the cached copy of the an error occure saying , IObject scope already closed
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Telerik.OpenAccess.Exceptions.InvalidOperationException: The 'IObjectScope' is already closed
Source Error:
here is the code
when repeater try to read the cached copy of the an error occure saying , IObject scope already closed
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Telerik.OpenAccess.Exceptions.InvalidOperationException: The 'IObjectScope' is already closed
Source Error:
Line 32: public string Title
Line 33: {
Line 34: get { return title; }
Line 35: set { this.title = value; }
Line 36: }
|
here is the code
IObjectScope scope = ScopeUtility.GetScope(); |
if (HttpContext.Current.Cache["regions"] != null) |
return (List<ProductRegion>)HttpContext.Current.Cache["regions"]; |
List<ProductRegion> list = (from fn in scope.Extent<ProductRegion>() select fn).ToList(); |
HttpContext.Current.Cache.Insert("regions", list.ToList()); |
return list; |