Deleting Items from a Collection - Adapter

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 03-Mar-2006 19:04:18   

Hi All,

Here is what I have:

Object A --> Collection of Object B's

If I call:

ObjectA.BCollection.Remove(0) ObjectA.BCollection.Remove(1) Adapter.Save(ObjectA)

What's the best way to get the adapter to delete the removed item? Do I have to manually call the delete method from the Adapter? is there a way to flag an item for deletion when it is removed from a entity collection?

Thanks.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 04-Mar-2006 02:37:41   

No there isn't, but you could just add the entities to a deleteCollection. Then when you are done removing them from one collection and placing them in the delete collection where you can submit them to be deleted.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 04-Mar-2006 02:49:09   

You could also add these entites to a Unit of Work to be deleted and then commit once it is ready.