Web ObjectScope option

3 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 07 Dec 2009 Link to this post

    Referencing this article:

    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(); 
                    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); 

  2. Zoran
    Zoran avatar
    534 posts

    Posted 10 Dec 2009 Link to this post

    Hello Steve,

     We will treat this as a feature request. It will be discussed here in our team and we could add some option that will make the generation of ObjectScopeProvider class to use a different template. We will notify you as soon as we make some decision regarding this feature.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Alfred Ortega
    Alfred Ortega avatar
    193 posts
    Member since:
    May 2005

    Posted 26 Feb 2010 Link to this post

    Since many applications will not be used in a web environment could you instead make it an extension method in some new class (Telerik.OpenAccess.Web.ExtensionLibrary)  This way it is available for all your web apps but not an option for others?

Back to Top