How can you serialize anonymous type with C # protobuf-net?

using ProtoBuf;

    var anon = new { Id = Guid.NewGuid(), Name = "Yan", Age = 29 };        

Serializer.Serialize(anon.ToString(), anon.GetType().BaseType);

      

Is it possible to serialize anonymous types in C # using protobuf-net? The above is a simplification of the script

Actually I have a stream of message signatures like (string message, data of anonymous type, string secondMessage);

+3
c # serialization protobuf-net


source to share


No one has answered this question yet

Check out similar questions:

3575
How to list a transfer?
2058
How do I get a consistent byte representation of strings in C # without manually specifying the encoding?
1743
What's the best way to give a C # auto property an initial value?
1742
How to calculate a person's age in C #?
1270
Why not inherit from List <T>?
1071
JavaScriptSerializer - JSON serialization of an enum as a string
838
How do I turn a C # object into a JSON string in .NET?
530
How do you make a deep copy of an object in .NET (like C #)?
437
Can an anonymous class implement an interface?
0
Could this be serialized with protobuf-net?



All Articles
Loading...
X
Show
Funny
Dev
Pics