I believe I have a problem with a circular reference in my Domain. I am used to model references between two objects on both sides as this is how Entity Framework handles this:
Receipt -> IngredientList
Ingredient -> Receipt
I tried using POCOs based on DataObjectBase<...> as model objects for the EF4. This seems to work fine at first, both with and without ProxyCreationEnabled.
But now I prefetched some data (with the EF Include statement), and initializing the ViewModel I get a stack overflow exception. I believe this is due to the circular dependency between my data objects when Catel starts serializing the object.
Is there anything I can do about this or did I simply miss something?
I also believe to have another issue. My first try used lazy loading. So displaying the Receipt automatically loaded the list or my ingredients and displayed them (at this time the Catel serialization and deserialization worked, as it probably happens before
lazy loading). After closing and reopening the viewmodel for a specific Receipt, the Ingredients are gone. I believe that Catel treated the Lazy loadings as modification to the object and called CancelEdit later on. Reopening the Receipt then found no more
Ingredients (or did not use lazy loading again).
Do you have any comment on this?