This is a migrated thread and some comments may be shown as answers.

Context version of Scope.GetSqlQuery?

1 Answer 113 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Garry
Top achievements
Rank 1
Garry asked on 09 Aug 2010, 06:04 PM
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.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Petko_I
Telerik team
answered on 10 Aug 2010, 04:02 PM
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,
Petko_I
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
Tags
Development (API, general questions)
Asked by
Garry
Top achievements
Rank 1
Answers by
Petko_I
Telerik team
Share this question
or