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

"Enable Project to use ORM" not available

2 Answers 64 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
King Wilder
Top achievements
Rank 2
King Wilder asked on 17 Oct 2010, 06:35 PM
I have OA version 2010.2.714.1 and I was thinking about using OQL.  Looking at the documentation, it doesn't seem like it can be used if I generate my entities using the Visual Designer.  But when I click the Telerik menu, I don't get the option to "Enable Project to use ORM".

Two questions:
  1. How do I find this menu?
  2. Do I need this to use OQL?

Thanks,

King Wilder

2 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 20 Oct 2010, 06:12 PM
Hi King Wilder,

OQL is an interface to OpenAccess that has been there since the early days of the product, when there was no LINQ available. While it was a perfectly good solution at the time, we feel that is more or less inappropriate nowadays. These are the reasons to not include it, at least not publicly, in the designer. There is a way to use OQL in the new designer. What you need to do is extend the context class in a partial with a new property that exposes the inner scope. You code should look like this : 

public partial classYourContextNameHere
{
    public IObjectScope Scope
    {
        get
        {
            return this.GetScope();
        }
    }
}

However we feel there is not need for this when we have Dynamic Linq available. Also if you are comfortable working with OpenAccess Classic you can easily switch back to this. You just need to follow the steps described in this blog post.

I hope this is helpful. 

Sincerely yours,
Serge
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
0
King Wilder
Top achievements
Rank 2
answered on 20 Oct 2010, 06:35 PM
Serge,

Thanks for the info.  I got it to work as you suggested.  I was looking into this for a client.  I'm going to try and convince them to go with the latest baked in scenario and use Linq against the context instead.  It's much more straight forward, IMHO.

King Wilder
Tags
Getting Started
Asked by
King Wilder
Top achievements
Rank 2
Answers by
Serge
Telerik team
King Wilder
Top achievements
Rank 2
Share this question
or