Page 1 of 1
Eager Load
Posted: Tue 22 Feb 2011 08:02
by F8R
Hi, I'm evaluating LINQ Connect for my next project.
I'm new to LINQ also, I have this query :
Code: Select all
var categories = from c in ctx.Categories.LoadWith(n => n.Products)
orderby c.CategoryName ascending
select c;
This query was eager load, but I want to output :
But from tracing sql statement, when I accessing Product from second query, Product was retrive using lazy-load.
Thanks
Posted: Tue 22 Feb 2011 16:40
by StanislavK
Thank you for your report, we have reproduced the issue. We will analyze it and inform you about the results as soon as possible.
Posted: Mon 28 Feb 2011 21:55
by F8R
Let me know when this problem fixed, because I needed this feature in my project.
Posted: Wed 02 Mar 2011 12:44
by StanislavK
We are working on this issue, and will post here as soon as it is fixed.
As a temporary workaround, you can select the whole entity object in the query, enumerate the sequence, and then select an anonymous type, e.g.,
Code: Select all
var categories = from c2 in
(from c in ctx.Categories.LoadWith(n => n.Products)
orderby c.CategoryName ascending
select c)
.ToList()
select new { c2.Name, c2.Products };
Posted: Thu 19 May 2011 11:25
by StanislavK
We have fixed the issue with eager loading for queries that include anonymous types. The fix is available in the latest 2.50.23 version of LinqConnect. The new build can be downloaded from
http://www.devart.com/linqconnect/download.html
(the trial version) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/
For the detailed information about the improvements and fixes available in LinqConnect 2.50.23, please refer to
http://www.devart.com/forums/viewtopic.php?t=21036