Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

Serialization and deserialization can only use the same class #84

@MuNet

Description

@MuNet
        private class LogBook
        {
            public long Id { get; set; }

            public string Name { get; set; }
        }

        private class LogEntry
        {
            public long Id { get; set; }

            public string Name { get; set; }
        }

The following code does not work, do you have any good suggestions?

         var log = new LogBook { Id = 1, Name = "abc" };
        var bytes = binaryConverter.Serialize(log);
       
        //error occurred
        var log2 = binaryConverter.Deserialize<LogEntry>(bytes);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions