Context version of Scope.GetSqlQuery?

2 posts, 0 answers
  1. Garry
    Garry avatar
    205 posts
    Member since:
    Nov 2010

    Posted 09 Aug 2010 Link to this post

    I used to use scope.GetSqlQuery, but now that I am using the new context objects I can't seem to be able to run straight TSQL against OpenAccess. Am I missing something or is there context method similar to the old scope one? I know I can run stored procedures, but I really just need ot be able to pass in a TSQL query this time.

  2. Petko_I
    Petko_I avatar
    184 posts

    Posted 10 Aug 2010 Link to this post

    Hello Garry Clark,

    Currently the functionality you require is not directly exposed through the new context. However, you can create a partial class which extends the generated Entity Diagrams context and expose the protected method GetScope() to retrieve an instance of the old scope.

    public partial class NorthwindContextWithScope : NorthwindContext
        public IObjectScope GetInternalScope()
            return this.GetScope();

    Here we assume that NorthwindContext is the generated class which extends OpenAccessContext. With the IObjectScope available you can make use of the GetSqlQuery method as well as some other functionality which you feel is missing.

    Should you want to know something else, do not hesitate to contact us.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top