Folks,
I have a Editable Root class that has a Child List as part of the class.
When I am testing a SAVE for the Editable Root, I am doing an Add to the child list:
EditableRoot.ChildList.Add(item);
Then I do the EditableRoot.ApplyEdit(); and EditableRoot.Save();
It looks like the Update to the ChildList isn't causing the isDirty to be set, so the Save does nothing (doesn't call Dataportal.Insert or Dataportal.Update on the EditableRoot).
I am using CSLA 2.1 -- any ideas? I'm sure it's probably something basic I'm not doing in the child list.
Actually it is something basic you are not doing in the Root BO.
You should always override IsValid and IsDirty to account for the presence of the Child Collection or Child BO.
Page 417 of the VB book has a sample:
IsValid:
Return MyBase.IsValid AndAlso mResources.IsValid
IsDirty:
Return MyBase.IsDirty OrElse mResources.IsDirty
Joe
Copyright (c) Marimer LLC