Devart.Data.Linq.Queryable.LoadWith extension method

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
DavidF
Posts: 18
Joined: Fri 11 Oct 2013 10:07

Devart.Data.Linq.Queryable.LoadWith extension method

Post by DavidF » Mon 14 Jul 2014 14:44

The Devart.Data.Linq.Queryable.LoadWith extension method does not behave correctly when there is a cached entity present in the data context

e.g.

var parentEntity = context.ParentEntities.FirstOrDefault();

var parentEntity2 = parentEntity.LoadWith(x => x.EntityAs)
.LoadWith(x => x.EntityBs).FirstOrDefault();

only association parentEntity2.EntityAs is populated, parentEntity2.EntityBs is empty

Using Devart LinqConnect for Metro (SQLite) v 4.4.463

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Devart.Data.Linq.Queryable.LoadWith extension method

Post by MariiaI » Wed 16 Jul 2014 07:37

Thank you for the report on this. We have reproduced this issue. We will investigate it in more details and inform you about the results as soon as possible.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Devart.Data.Linq.Queryable.LoadWith extension method

Post by MariiaI » Tue 29 Jul 2014 12:27

We have investigated this issue in more details. This behaviour can be reproduced only when trying to see the results of the "parentEntity2" object in Debug mode and this issue is related to the peculiarities of Metro style applications (this behaviour is not reproducible with a simple Console application and LinqConnect Professional). If you iterate these two collections, you will see that the data is obtained correctly.
For example:

Code: Select all

var values1 = parentEntity2.EntityAs.ToList();// the result is ok
var values2 = parentEntity2.EntityBs.ToList();// the result is ok, values2 is not empty
We are sending you a sample project with the test database to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter. Please test it and tell us about the results.

Post Reply