Retreiving Collection without all of the records

Posts   
 
    
aim48
User
Posts: 9
Joined: 21-Nov-2005
# Posted on: 21-Nov-2005 17:41:42   

Hi,

I would like to add a record to a collection but I don't want to retreive all of the records allready in the collection:

For example:

OrganizationEntity org = new OrganizationEntity(OrgID); org.IsActive = true; OrganizationSaleEntity orgzSale = new OrganizationSaleEntity(); orgzSale.MemberID = MemberID;

// here org.GetMultiOrganizationSale().Add(orgzSale); //

org.Save();

However the GetMulti - loads all of the records from the database (quite many) - is there any way to get get a non databound collection that is attached to a parent entity?

Thanks

Paul.Lewis
User
Posts: 147
Joined: 22-Aug-2005
# Posted on: 22-Nov-2005 04:55:27   

aim48 wrote:

Hi,

I would like to add a record to a collection but I don't want to retreive all of the records allready in the collection:

For example:

OrganizationEntity org = new OrganizationEntity(OrgID); org.IsActive = true; OrganizationSaleEntity orgzSale = new OrganizationSaleEntity(); orgzSale.MemberID = MemberID;

// here org.GetMultiOrganizationSale().Add(orgzSale); //

org.Save();

However the GetMulti - loads all of the records from the database (quite many) - is there any way to get get a non databound collection that is attached to a parent entity?

Thanks

Each entity also has empty collections to related tables.

Try something like this:


org.OrganizationSale.Add(orgzSale); 
org.Save(true);

The boolean true value in the Save method informs LLBLGen to perform a recursive save.

Let me know if I didn't interpret your question correctly.

aim48
User
Posts: 9
Joined: 21-Nov-2005
# Posted on: 22-Nov-2005 05:06:42   

Paul.Lewis wrote:

aim48 wrote:

Hi,

Each entity also has empty collections to related tables.

Try something like this:


org.OrganizationSale.Add(orgzSale); 
org.Save(true);

The boolean true value in the Save method informs LLBLGen to perform a recursive save.

Let me know if I didn't interpret your question correctly.

Thanks - Thats what I meant.