CSLA 4.5 - OnChildChanged gets called multiple times

CSLA 4.5 - OnChildChanged gets called multiple times

Old forum URL: forums.lhotka.net/forums/t/11620.aspx


skagen00 posted on Wednesday, October 03, 2012

I've got a unit test or two that broke on me because it's looking for too many mock dtos. 

Structure is this -

Root BO - contains EditableList of Editable BO.

When an editable BO's simple "Name" property changes, OnChildChanged is getting called 7 times in the Root BO.  Pre 4.5 it's only getting called once.

Going to see if I can figure out what is going on.

JonnyBee replied on Wednesday, October 03, 2012

Hi,

Probably caused by the IsXYZ properties also raising OnPropertyChanged on the EditableChild.

skagen00 replied on Wednesday, October 03, 2012

Sorry, I figured it out - these child property changes are getting captured.

test - 0 (0) - IsSelfDirty

test - 0 (0) - IsDirty

test - 0 (0) - IsSavable

test - 0 (0) - IsSelfValid

test - 0 (0) - IsValid

test - 0 (0) - IsSavable

test - 0 (0) - BankName

skagen00 replied on Wednesday, October 03, 2012

This behavior is likely to remain like this, right? (Just want to check before I change code & tests to adjust for it)

RockfordLhotka replied on Thursday, October 04, 2012

I don't think we plan to change this behavior.

Copyright (c) Marimer LLC