WithPath?

Posts   
 
    
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 16-Jun-2008 09:00:06   

Hi,

just trying to follow some of the linq examples in the doc... in regard to prefetchs it says I need to use this method called "WithPath".

I've done this:

using (DataAccessAdapter adapter = new DataAccessAdapter()) { LinqMetaData metaData = new LinqMetaData(adapter); var q = (from c in metaData.Role select c).WithPath..?

Only I can't seem to go much further as there's no WithPath method in existance.

This is the example i was referencing:

var q = (from c in metaData.Customer where c.Country=="UK" select c).WithPath(p=>p.Prefetch(c=>c.Orders));

I don't see where i've done wrong.... disappointed

worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 16-Jun-2008 09:03:04   

...i added: using SD.LLBLGen.Pro.LinqSupportClasses;

and it magically appeared. Solved

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 16-Jun-2008 09:55:08   

WithPath is an extension method, so it needs the namespace. VS.NET 2008 should show the smarttag below it.

Frans Bouma | Lead developer LLBLGen Pro
wordracr
User
Posts: 12
Joined: 16-Sep-2009
# Posted on: 16-Sep-2009 22:43:15   

The smart tag doesn't show, so the namespace has to be resolved manually. That's strange! It threw me for a loop when WithPath() wasn't found and there was no smart tag visible.

I love using ctrl+. to quickly include namespaces after you correctly type an object name (ie WithPath), but without having resolve be available, we need to manually add in the using line.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Sep-2009 06:09:41   

If I put .WithPath() without the using clause, VS2k8 shows me the smart-tag.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 17-Sep-2009 10:00:04   

That's Resharper I think wink . VS.NET doesnt automatically show smarttags for extension methods, Resharper does. So please put the using statement at the top of the code file (using SD.LLBLGen.Pro.LinqSupportClasses;

Frans Bouma | Lead developer LLBLGen Pro