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

Extent method not exits

15 Answers 445 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.
NADAV YEHESKEL
Top achievements
Rank 2
NADAV YEHESKEL asked on 03 Jul 2009, 12:00 PM
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


15 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 03 Jul 2009, 12:14 PM
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.
0
Sam
Top achievements
Rank 1
answered on 08 Nov 2009, 07:12 PM
i found it in different place
using Telerik.OpenAccess; 
it only worked for me after adding this line
0
PetarP
Telerik team
answered on 09 Nov 2009, 09:59 AM
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.
0
Sam
Top achievements
Rank 1
answered on 11 Nov 2009, 12:31 PM
Thanks
0
Majid
Top achievements
Rank 2
answered on 14 Mar 2010, 08:54 AM
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
0
Brian
Top achievements
Rank 2
answered on 14 Mar 2010, 10:51 PM
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.


0
KJF
Top achievements
Rank 2
answered on 15 Mar 2010, 03:27 PM
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...
0
Brian
Top achievements
Rank 2
answered on 15 Mar 2010, 03:33 PM
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
0
KJF
Top achievements
Rank 2
answered on 15 Mar 2010, 03:42 PM
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
0
PetarP
Telerik team
answered on 16 Mar 2010, 05:51 PM
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.
0
Marco Leonardi
Top achievements
Rank 1
answered on 01 Jun 2010, 07:08 AM
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?
0
Roland
Top achievements
Rank 1
answered on 01 Jun 2010, 07:54 PM
Hello,

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

Regards
Roland
0
PetarP
Telerik team
answered on 03 Jun 2010, 11:36 AM
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.
0
Joshua Kent
Top achievements
Rank 2
answered on 04 Jun 2010, 10:02 PM
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
0
Damyan Bogoev
Telerik team
answered on 07 Jun 2010, 05:56 PM
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.
Tags
Getting Started
Asked by
NADAV YEHESKEL
Top achievements
Rank 2
Answers by
Alexander
Telerik team
Sam
Top achievements
Rank 1
PetarP
Telerik team
Majid
Top achievements
Rank 2
Brian
Top achievements
Rank 2
KJF
Top achievements
Rank 2
Marco Leonardi
Top achievements
Rank 1
Roland
Top achievements
Rank 1
Joshua Kent
Top achievements
Rank 2
Damyan Bogoev
Telerik team
Share this question
or