LoadWith()

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
[email protected]
Posts: 43
Joined: Wed 17 Sep 2008 11:31

LoadWith()

Post by [email protected] » 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 [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by 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;

Post Reply