Serializable property in editable root BusinessListBase #2909
-
With an editable root public MyListTypeEnum Type { get; private set; } The value is lost in translation. This can sometimes be solved with a generic base class and an abstract property, but it's more painful to implement the UI. Are we meant to have a parent |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I think what you are asking is for properties and business rules to exist in BusinessListBase? |
Beta Was this translation helpful? Give feedback.
-
A solution for CSLA 6 is to remember that everything is serialized via So you can override the get/set methods for field values: protected override void OnGetState(SerializationInfo info)
{
base.OnGetState(info);
}
protected override void OnSetState(SerializationInfo info)
{
base.OnSetState(info);
} Then you can get/set your property or field value(s) as necessary in the serialization stream and they'll flow through cloning and the data portal. |
Beta Was this translation helpful? Give feedback.
A solution for CSLA 6 is to remember that everything is serialized via
MobileFormatter
, which means that all the base types ultimately implementIMobileObject
- includingBusinessListBase
.So you can override the get/set methods for field values:
Then you can get/set your property or field value(s) as necessary in the serialization stream and they'll flow through cloning and the data portal.