Skip to content

Csla 5 to 8 upgrade, dealing with non-csla properties. #4456

Discussion options

You must be logged in to vote

Microsoft has stopped supporting the BinaryFormatter, and so CSLA has also stopped using it. As a result, the serializer is now MobileFormatter.

MobileFormatter automatically works with managed backing fields. If you have private backing fields or non-CSLA properties, then it is up to you to set/get the values during serialization.

To do this, there are methods you can override to participate in the serialization process.

        public string SomeValue { get; set; } = "SomeValue";

        protected override void OnSetState(SerializationInfo info, StateMode mode)
        {
            info.AddValue(nameof(SomeValue), SomeValue);
            base.OnSetState(info, mode);
        }

        p…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rockfordlhotka
Comment options

@rockfordlhotka
Comment options

@Gevand
Comment options

Answer selected by Gevand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants