Extent method not exits

16 posts, 0 answers
  1. NADAV YEHESKEL
    NADAV YEHESKEL avatar
    4 posts
    Member since:
    Dec 2008

    Posted 03 Jul 2009 Link to this post

    hello,
    I try to compile the sample in chapter 1 in "OpenAccess - MadeEasy" :

    using (IObjectScope scope = ObjectScopeProvider1.ObjectScope()) 
                { 
                    scope.Transaction.Begin(); 
                    // add a new customer 
                    Customer newnewCustomer = new Customer(); 
                    newCustomer.CustomerID = "A" + System.DateTime.Now.ToString("hmsfff"); 
                    newCustomer.CompanyName = "New Customer"
                    scope.Add(newCustomer); 
                    // get first customer using LINQ and modify 
                    Customer firstCustomer = 
                    scope.Extent<Customer>().Take(1).Single(); 
                    firstCustomer.CompanyName = 
                    "Company " + DateTime.Now.ToString("hmsfff"); 
                    scope.Add(firstCustomer); 
                    // use LINQ to retrieve customer ID's starting with "E" 
                    var results = 
                    from c in scope.Extent<Customer>() 
                    where c.CompanyName.StartsWith("E") 
                    select c; 
                    // delete "E" customers from the database 
                    foreach (Customer cust in results) 
                    { 
                        foreach (Order order in cust.Orders) 
                        { 
                            foreach (OrderDetail detail in order.OrderDetails) 
                            { 
                                scope.Remove(detail); 
                            } 
                            scope.Remove(order); 
                        } 
                        scope.Remove(cust); 
                    } 
                    scope.Transaction.Commit(); 
                } 
                Console.Write("Done"); 
                Console.ReadLine(); 
            } 
     


    Build error :

    Error    2    'Telerik.OpenAccess.IObjectScope' does not contain a definition for 'Extent' and no extension method 'Extent' accepting a first argument of type 'Telerik.OpenAccess.IObjectScope' could be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\TestReverseMapping\TestReverseMapping\Program.cs    23    23    TestReverseMapping

    Please help...

    thanks,

    shimon


  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 03 Jul 2009 Link to this post

    Hello Nadav,

    The Extent<T>() method is an extension method and takes place in our Telerik.OpenAccess.Query assembly as it contains our Linq implementation. Please add a reference to the Telerik.OpenAccess ORM .NET 3.5 assembly and include this statement at the top of your source code file:
    using Telerik.OpenAccess.Query; 
    Then the error should no longer exist.

    Best wishes,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Sam
    Sam avatar
    11 posts
    Member since:
    Oct 2009

    Posted 08 Nov 2009 Link to this post

    i found it in different place
    using Telerik.OpenAccess; 
    it only worked for me after adding this line
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 09 Nov 2009 Link to this post

    Hello Sam,

    The extension method Extent() that is the main entry point for creating LINQ queries has been moved out of the Telerik.OpenAccess.Query namespace to the Telerik.OpenAccess namespace so that less using statements are required. This change was introduced with the Q3 2009 release. In the previous versions to use the Extent() method it was required to include Telerik.OpenAccess.Query.

    Best wishes,
    Petar
    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.
  6. Sam
    Sam avatar
    11 posts
    Member since:
    Oct 2009

    Posted 11 Nov 2009 Link to this post

    Thanks
  7. Majid
    Majid avatar
    9 posts
    Member since:
    Dec 2008

    Posted 14 Mar 2010 Link to this post

    Hi
    I have latest release of ORM(2010.1.310.2) and facing same problem even i have included reference also.
    Can you help me?

    Regards
  8. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 14 Mar 2010 Link to this post

    In the latest release, the .Query.dll was removed.

    Make sure that you have referenced .Web.dll or .Win.dll instead as well as .35Extensions.dll or .40Extensions.dll .

    You should then be able to find .Extent through the Telerik.OpenAccess namespace after you made the references.


  9. KJF
    KJF avatar
    5 posts
    Member since:
    Aug 2009

    Posted 15 Mar 2010 Link to this post

    Could you please point out what references you are talking about specifically as I am also using the 2010 release and cannot get the compiler past the extent error as well...

    Thanks very much in advance...
  10. Brian
    Brian avatar
    35 posts
    Member since:
    Dec 2007

    Posted 15 Mar 2010 Link to this post

    OpenAccess usually adds the references if you use the "Enable Project" wizard.

    You can also try the menu in VS: "OpenAccess > Configuration > Check Settings"  this will alert you to any old assembly references.



    If you want to do it manually:

    Telerik.OpenAccess.dll
    Telerik.OpenAccess.Adonet2.dll
    Telerik.OpenAccess.Runtime.dll
    Telerik.OpenAccess.35.Extensions.dll
    Telerik.OpenAccess.Config.dll
    Telerik.OpenAccess.Web.dll
    Telerik.OpenAccess.Windows.dll

    If you are on VS2010 and using 4.0 framework, include Telerik.OpenAccess.40.Extensions.dll
  11. KJF
    KJF avatar
    5 posts
    Member since:
    Aug 2009

    Posted 15 Mar 2010 Link to this post

    Brian thanks. I added them manually and all is working fine now.

    I did originally use the enable project wizard but they were not added. I am using vs2008.


    Thanks again...

    Kevin
  12. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 16 Mar 2010 Link to this post

    Hello KJF,

    We have fixed this in the build we published on Friday (version 2010.1.312.11). Now the Enable project wizard should add the correct references.

    All the best,
    Petar
    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.
  13. Marco Leonardi
    Marco Leonardi avatar
    1 posts
    Member since:
    May 2010

    Posted 01 Jun 2010 Link to this post

    Hi.

    I got the same problem. I'm using version 2010.1.527.2.
    The Wizard does automatically add the reference of Telerik.OpenAccess.35.Extensions to my Project. With this reference I have the Extent method!
     But my project have to work with  .NET 4.0 and then I have to add the Reference Telerik.OpenAccess.40.Extensions. In this scenario the Extent method is missing!

    Why?
  14. Roland
    Roland avatar
    4 posts
    Member since:
    Sep 2008

    Posted 01 Jun 2010 Link to this post

    Hello,

    I have the same problem, that "Extent" is missing in version 2010.1.527.2.

    Regards
    Roland
  15. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 03 Jun 2010 Link to this post

    Hi Roland,

    If you remove the reference to Telerik.OpenAccess.35.Extensions you will end up with missing Extent method. Please make sure that your project references Telerik.OpenAccess.35.Extensions.

    Sincerely yours,
    Petar
    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.
  16. Joshua Kent
    Joshua Kent avatar
    15 posts
    Member since:
    Nov 2009

    Posted 04 Jun 2010 Link to this post

    Telerik, Can you please update the documentation at (http://www.telerik.com/help/openaccess-orm/deploying-openaccess-operations-and-versioning.html) it still mentions OpenAccess.Query.dll and I was lost until I found this post mentioning that it had been replaced with the extensions dll.

    Thanks,
       Josh
  17. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 07 Jun 2010 Link to this post

    Hi Joshua Kent,

    We are sorry for the inconvenience caused. We will do our best to update the online documentation as soon as possible.

    Sincerely yours,
    Damyan Bogoev
    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.
Back to Top
DevCraft banner