Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Proper Way to Delete Child Object

$
0
0

I am wondering what is the proper way to delete a child object.  We have a Borrower object that has an Address object as a child.  Under a certain case we want to delete the Address object.  We have found that if we MarkDeleted on the child object, when saving it does the Delete and then it returns the Parent with a NEW Address with the same properties.  After looking at the code (CSLA 4.5.30.0) I find in the ChildDataPortal.cs after it does the Child_DeleteSelf call it then calls MarkNew().  I am assuming that this is what is causing this behavior.  This leads me to the question of what is the correct way to delete the child object and remove it from the parent object when saving the parent.


Viewing all articles
Browse latest Browse all 764

Trending Articles