Is DataMember(Order=n) annotation required for protobuf-net v2?

后端 未结 2 1376
时光说笑
时光说笑 2020-12-09 06:45

Simple experiment: I created an entity model from Northwind, and find that the generated classes don\'t work for protobuf-net v2 without adding the Order proper

2条回答
  •  我在风中等你
    2020-12-09 07:13

    I've only just begun my dive into ProtoBuf, and therefore haven't really looked at the previous version, but I've been using looking at the stream that is generated it's ordered as expected.

    
    Public Class Peer
       
        Public Property PacketNumber As Long
        
        Public Property DateCreated As DateTime
        
        Public Property Data As String 
        
        Public Property OriginatingTerminal As Integer
    end class
    

    Hope this helps

提交回复
热议问题