How to know if entity was pre-fetched.

Posts   
 
    
A.Alamo
User
Posts: 12
Joined: 12-Aug-2011
# Posted on: 28-Sep-2011 18:24:13   

Hi, I need to know wheter a related entity was fetched or not in the last containing entity fetch, anyway to do that?

I am using llblgen 3.1 with linq.

thanks.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-Sep-2011 04:31:16   

If you use SelfServicing, there is a property for each related entity/collection called AlreadyFetchedCustomer<Navigator>. Example:

bool didIFetchedCustomer = order..AlreadyFetchedCustomer;
bool didIFetchedOrderDetails = order..AlreadyFetchedOrderDetails;

For adapter, there is no such property. The reason is the nature of the adapter paradigm: Entities are disconnected objects persistence independent. There is a long discussion about this, if you want to take a look: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=2013

David Elizondo | LLBLGen Support Team