Today I Learned: Protobuf and replace switch in JS
A short update about several interesting issues that i faced in today How-to use Protobuf You should install protobuf-net from nuget and then: // Explicit proto contract [ProtoContract] public class MappedEntity { [ProtoMember(1)] public int Id { get; set; } [ProtoMember(2)] public string Name { get; set; } } var entity = new MappedEntity { Id = 1, Name = "123" }; // Serialize/deserialize using protobuf-net byte[] serialized; using (var ms = new MemoryStream()) { Serializer.Serialize(ms, entity); serialized = ms.ToArray(); } MappedEntity deserialized; using (var ms = new MemoryStream(serialized)) { deserialized = Serializer.Deserialize<MappedEntity>(ms); } More information about usage, issues and problems in Protobuf you can get from this article in Russian ...