FetchEntityCollection overload that accepts Context object

Posts   
 
    
s0kol
User
Posts: 2
Joined: 19-Mar-2008
# Posted on: 19-Mar-2008 12:50:55   

Hi,

I am working on an application that utilizes Context in the Adapter model. At one point I need to retrieve a collection of entities. It is possible that some or most likely all of the entities that will be retrieved have already been loaded and are known to my Context object.

Now, I wanted to go about this in the way I would with a single entity. So I planned to use a FetchEntityCollection method of a DataAccessAdapter object that accepts a Context object but as it turns out there is no such overload. Even though it says in the LLBLGenPro manual, chapter "Generated code - Using the context, Adapter", that there is:

"Fetching an entity or set of entities and using a prefetch path can fully utilize a Context by one of the overloads of FetchEntityCollection, FetchEntity, FetchNewEntity etc., which accepts a Context object."

confused

Am I missing something? Or maybe is it enough to first add the empty collection object to the Context and then call the FetchEntityCollection method to make LLBLGen first check the context object for entities.

I'll appreciate any hints or alternative ways of achieving my goal.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-Mar-2008 16:08:32   

I see what you mean, we will check it out and get back to you. Thank you for the catch.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 19-Mar-2008 16:52:37   

You've to add the collection to the context and then call the fetch method. It's indeed a glitch in the manual. We'll correct the manual text so it explains what really should be done simple_smile

Frans Bouma | Lead developer LLBLGen Pro
s0kol
User
Posts: 2
Joined: 19-Mar-2008
# Posted on: 19-Mar-2008 16:55:27   

Ok. Thanks for the quick answer.