"Enable Project to use ORM" not available

3 posts, 0 answers
  1. King Wilder
    King Wilder avatar
    240 posts
    Member since:
    Oct 2007

    Posted 17 Oct 2010 Link to this post

    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. Serge
    Admin
    Serge avatar
    375 posts

    Posted 20 Oct 2010 Link to this post

    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
  3. DevCraft banner
  4. King Wilder
    King Wilder avatar
    240 posts
    Member since:
    Oct 2007

    Posted 20 Oct 2010 Link to this post

    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
Back to Top