Does protobuf-net support [DataMember(Order=0)]?

后端 未结 1 1161
野的像风
野的像风 2021-01-20 18:58

I am using protobuf-net with WCF, and finding that data members with Order = 0 are not showing up on the client. Here is my data contract - ObjectId is always Guid.Empty on

相关标签:
1条回答
  • 2021-01-20 19:46

    Odd - I would have expected it to error with that. Protobuf key numbers are always positive, so 0 is indeed not valid for protobuf-net. Hence I would expect it to throw! For this reason, it. Is also possible to specify an offset to apply to WCF keys (intended primarily for use with proxy types). This can be done via ProtoContractAttribute (directly, or in a "partial class" if using proxy generation), or can probably (I haven't checked) be applied at runtime via RuntimeTypeModel.

    0 讨论(0)
提交回复
热议问题