object as property but not child

object as property but not child

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


MTmace posted on Thursday, May 14, 2009

I have a one to many relationship in the database so my object model has a business base with another business base as a property. Does that second object have to be a child object? Currently it is not and I am getting a EditLevelMismatchException when I acceptchanges or undo them.

Thanks,

MTmace

rsbaker0 replied on Friday, May 15, 2009

CSLA doesn't quite support this 100% yet but you can make it work except in edge cases (undo where the object reference is changed).

Are you using a CSLA managed property? If so, CSLA should update the edit level for you automatically when you set or load the property value.

If you aren't using managed properties, then I recommend doing so, if only properties which are either child lists or other objects. CSLA will handle keeping the edit level up to date for you and avoid bugs like this.

Copyright (c) Marimer LLC