Recursive Save (Adapter)

Posts   
 
    
IowaDave
User
Posts: 83
Joined: 02-Jun-2004
# Posted on: 18-Apr-2005 19:46:40   

I don't understand how to delete some of the related entities in a single save of the entity.

I have CompanyEntity and a 1:m child entity CompanyAddress

If I want to delete one or more company addresses, do I need to call a DeleteEntity on each one or can I somehow just save the company, and if so, how do I mark the companyaddresses that I want to delete?

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 18-Apr-2005 20:53:18   

Deletes aren't done when you save, when you save, changes are saved, no deletes are performed. If you want to delete entities, either add them to a collection and delete the collection, or preferably use a UnitOfWork object to perform the saves and the deletes in one go.

Frans Bouma | Lead developer LLBLGen Pro