Edit Level Mismatch when child property is also contained within different child collection.

Edit Level Mismatch when child property is also contained within different child collection.

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


Devman posted on Friday, May 13, 2011

Hi,

There is an issue with the following scenario which is common within our application;

A BusinessBase has a child Images collection. The BB also has a PrimaryImage property which references an Image object within the child images collection. 

When it comes to saving and more specifically when ApplyEdit is called after changing the PrimaryImage property an Edit Level Mismatch exception is thrown.

How do we solve this issue?

Regards

David

 

RockfordLhotka replied on Friday, May 13, 2011

The PrimaryImage property must be implemented using a private backing field, and that field must be marked with the NotUndoable attribute.

Devman replied on Friday, May 13, 2011

Thats it, many thanks!

Copyright (c) Marimer LLC