is there any reason why the OnChildChanged will not work in CSLA 4 SL4?
//parent
public partial class OrgStructureER : BusinessBase<OrgStructureER>
{
protected override void OnChildChanged(Csla.Core.ChildChangedEventArgs e)
{
// not throwing
}
we change properties in this child:
private static readonly PropertyInfo<CompanyEC> CompanyProperty = RegisterProperty<CompanyEC>(p => p.Company, RelationshipTypes.Child);
public CompanyEC Company
{
get
{
//if (FieldManager.FieldExists(CompanyProperty))
return ReadProperty(CompanyProperty);
//else
// return null;
}
set
{
LoadProperty(CompanyProperty, value);
}
}
// child is a BusinessBase
I tried al the diffrent RelationshipTypes... not working ...
OnChildChanged is designed to work with child collections. You have a single instance of an object as a child. In that case, CSLA won't manage that for you. You have to hook into the change events yourself.
HTH
- Scott
sorry scott your answer is incorrect, we test it with a normal TestER and TestChildEC, it works, but for our advance objects with ER to EC with ECL it is not working...
Your failure scenario is:
BB (root) with BB (child) with BLB (child) with (BB) child
And when a child of the BLB is changed, the event doesn't cascade up to the root?
Sorry guys, found my mistake, I used LoadProperty instead of SetProperty in my child objects. Everything works fine now. BB(root) with BB (child) with BLB(child) recursive works, BB(root) onChildChange works for all children BB(child) and BLB(child).
Copyright (c) Marimer LLC