Example #1
0
 private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
 {
     if (e.NewState == ObjectState.Deleted)
     {
         ClearNavigationProperties();
     }
 }
Example #2
0
 // This entity type is the dependent end in at least one association that performs cascade deletes.
 // This event handler will process notifications that occur when the principal end is deleted.
 internal void HandleCascadeDelete(object sender, ObjectStateChangingEventArgs e)
 {
     if (e.NewState == ObjectState.Deleted)
     {
         this.MarkAsDeleted();
     }
 }