How to add new entities in one round trip?

Posts   
 
    
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 14-Sep-2005 09:00:46   

Hi,

I create new customers, and I want to add them to the database. How can I do that in one round trip?

One solution might be creating Customer entitites, create an Entity collection, and add all the customer entities to them.

Is it possible to update this collection to the database without fetching an empty one?

Thanks

Gabor

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Sep-2005 09:28:58   

Sure, just create as you said an empty entitycollection, add the entities to that one and call SaveMulti() (Selfservicing) or SaveEntityCollection (adapter). Or you could add hte new entities to a UnitOfWork and commit that simple_smile

Every save is done individually, there's no 'batching' of statements.

Frans Bouma | Lead developer LLBLGen Pro