Hi,
I have these classes:
Child : BusinessBase
Parent : BusinessBindingListBase<Parent,Child>
In parent class i have:
protected override void DataPortal_Update()
{
Child_Update();
}
Parent list fetch some data from database and fill itself. Problem is when i call Save() on parent object, it updates EVERY child object, even those which i didn't edited at all. How can i fix this, and update only deleted/edited children?!
Hi,
In your Child_Update check for IsDirty and if false then just return.
Tnx Jonny. I did as you said, but, shouldn't CSLA do that check by itself? Or i did something wrong?!
There is situations where you need all the data to be present at the dal /remote side.
F.ex when using a messaging based system that needs ALL data - including those that were not changed by the user.
So the default action by CSLA is to call Child_Update on all children and your code can easiy decide whether or not to perform any action.
Copyright (c) Marimer LLC