Home > Software engineering >  protobuf-net: properties versus fields
protobuf-net: properties versus fields

Time:02-04

In our project, we have a data transfer object (DTO) class which is decorated with a [ProtoContract] attribute, and all of its members are public properties decorated with [ProtoMember] attributes - except that one of the members is a public field (by accident). Now we want to change the one public field into a property. Can this have an impact about the implicit protobuf contract? (We want to avoid breaking changes, and I suppose that this change is non-breaking, but I want to be sure.)

CodePudding user response:

Yes, that's absolutely fine; protobuf-net won't care, and the serialized payload will remain identical.

  •  Tags:  
  • Related