GetDependingRelatedEntities question

Posts   
 
    
Posts: 24
Joined: 11-Feb-2004
# Posted on: 12-Nov-2004 20:25:39   

Background: LLBLGen Pro. Version 1.0.2004.1 Final (Two class scenario templates)

I am running into a problem using the GetDependingRelatedEntities method of my EntityBase classes. Within LLBLGen, I have an entity with three relations (2 1:n and 1 m:1). It was my understanding that the 1:n relationships would be returned as an ArrayList of EntityCollections when I make a call to enity.GetDependingRelatedEntities(). However, the code generated always returns an empty ArrayList. However, the call to GetDependentEntities() returns the m:1 relationship. Is there something obvious I am missing?

Thanks!

This is the code in my EntityBase class:

        
public override ArrayList GetDependingRelatedEntities()
{
     ArrayList toReturn = new ArrayList();
     return toReturn;
}

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 13-Nov-2004 14:41:41   

GetDependingEntities is for 1:1 relations, where the entity you call that method on is on the PK side (so the entities returned are on the fk side, hence depending on the entity on the PK side wink )

You should call GetMemberEntityCollections(). As these collections always contain 1:n related entities, they are saved after the current entity is saved.

Frans Bouma | Lead developer LLBLGen Pro