O'Reilly Forums: Deleting With Self-Tracking Entities - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Deleting With Self-Tracking Entities

#1 User is offline   PulpMasher 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 25-January 13

Posted 25 January 2013 - 07:36 AM

My question is about deleting from the database using Self-Tracking Entities when I can’t use triggers or cascades.

I have a simplistic object graph which has a single top-level entity with a few child entities some of which are entity collections.

Something similar to:

     
                     Top-Level Entity
		               |
  ---------------------------------------------------------------
  |	             |	                   |	 	        |
Entity             Entity                Entity              Entity
                                        Collection   	   Collection


Only the top-level entity contains information that the user needs to see, and therefore when the model is read it only reads those entities.

When the user deletes one of the top-level entities, I receive that object on the server and as you’d expect I only have its primary key.

My question is this: What is the best way to load/process the object graph to delete each child entity and each entity collection and its children.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users