Explicitly Loading of Related Entities

2 posts, 1 answers
  1. stibiub
    stibiub avatar
    8 posts
    Member since:
    Jan 2013

    Posted 06 Feb 2013 Link to this post

    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.
  2. Answer
    Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 07 Feb 2013 Link to this post

    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.
  3. DevCraft banner
Back to Top