This is a migrated thread and some comments may be shown as answers.

Explicitly Loading of Related Entities

1 Answer 80 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
stibiub
Top achievements
Rank 1
stibiub asked on 06 Feb 2013, 04:59 PM
Hello,

Does OpenAccess support explicitly loading of related entities? And I don't mean "eager" loading which I know you can do with Fetch Plans.

In Entity Framework you can do explicit loading with the Load() method (from DbReferenceEntry and DbCollectionEntry):

// Load the blog related to a given post
   context.Entry(post).Reference(p => p.Blog).Load();

// Load the posts related to a given blog
   context.Entry(blog).Collection(p => p.Posts).Load();

Is there anything similar in OpenAccess?

I couldn't find it in "Programmer's Guide".

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 07 Feb 2013, 09:36 AM
Hello,

eager loading (as configurable with FetchPlans) allows for fetching related entities in a more efficient way than lazy loading. Nevertheless, all access to the related entites is still tracked, and can lead to a server fetch operation when the needed data is not present or outdated. If the data already fetched is available on the client, it is used and the accessed reference or collection object is just created in memory.
This means, there is no explicit loading of related entities call, as all accesses are tracked, and you just need to follow the reference or collection properties.

Kind regards,
Thomas
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
Data Access Free Edition
Asked by
stibiub
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or