LoadWith()

LoadWith()

Postby itcore@vit.ch » Mon 02 Nov 2009 10:19

Hello

I have the following query:

Code: Select all
from rc in MyDB.ReplicationCategories.LoadWith(rc => rc.Category)
select rc;


Each ReplicationCategory references exactly one Category which will be also loaded with the above query.

So far so good. Now, each category has n translations which I would like to load too:

Code: Select all
from rc in MyDB.ReplicationCategories.LoadWith(rc => rc.Category.LoadWith(c => c.CategoryTranslations))
select rc;


Unfortunately I got the error message "Category does not contain a definition for 'LoadWith'". Why isn't this method exposed there?

Best regards
________
STARCRAFT II REPLAYS
Last edited by itcore@vit.ch on Thu 17 Feb 2011 05:24, edited 1 time in total.
itcore@vit.ch
 
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Postby AndreyR » Tue 03 Nov 2009 09:43

This is designed behaviour, the Category class instance does not contain any definition for the
LoadWith method, it is EntitySet-level method.
This code should help:
Code: Select all
from rc in MyDB.ReplicationCategories.LoadWith(rc => rc.Category).LoadWith("Category.CategoryTranslations")
select rc;
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to LinqConnect (LINQ to SQL support)