Explicitly Loading of Related Entities

Thread is closed for posting
2 posts, 1 answers
  1. stibiub
    stibiub avatar
    8 posts
    Member since:
    Jan 2013

    Posted 06 Feb 2013 Link to this post


    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".

  2. Answer
    Thomas avatar
    590 posts

    Posted 07 Feb 2013 Link to this post


    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,
    the Telerik team
    Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Back to Top