c# - CSLA .NET - Child_Fetch not working as expected -
i posted on http://forums.lhotka.net/ , i'm not getting response. have better luck here. here problem.
i'm using csla .net 4.5, , added additional child_update method businessbase support parent businesslistbase in bulk saving. however, seemed of introduced bug in our system. looks if have 2 child_update methods , 1 of them parameterless, parameterless 1 won't called. if specify dataportal.updatechild no additional parameters beyond child object.
example in pseudo code:
public class somechild : businessbase<somechild> { //no longer called private void child_update() {} //newly added private void child_update(somenewparent parent) {} } public class somelegacyparent : businessbase<somelegacyparent> { private static readonly propertyinfo<somechild> somechildproperty = registerproperty<somechild>(x => x.somechild, relationshiptypes.child); public somechild somechild { { return getproperty(somechildproperty); } set { setproperty(somechildproperty, value); } } //use call child_update(), //calls child_update(somenewparent parent) dataportal.updatechild(readproperty(somechildproperty)); } public class somenewparent : businessbase<somenewparent> { private static readonly propertyinfo<somechild> somechildproperty = registerproperty<somechild>(x => x.somechild, relationshiptypes.child); public somechild somechild { { return getproperty(somechildproperty); } set { setproperty(somechildproperty, value); } } //calls child_update(somenewparent parent) --- expected dataportal.updatechild(readproperty(somechildproperty), this); }
now know csla uses reflection find correct data access method call, i'm not sure why parameterless method not distinguishable parameterized 1 based on arguments passed dataportal.updatechild? csla bug or missing something?
hmm, suspect bug in csla. try changing child_update() child_update(somelegacyparent) no longer have parameterless child_update. may have change legacy parents call updatechild pass 'this' well.
edit: per thread linked in answers comments, issue has been fixed in csla.
Comments
Post a Comment