Hermann.Gruber
Hermann.Gruber

Reputation: 1484

protobuf-net: properties versus fields

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.)

Upvotes: 3

Views: 509

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062975

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

Upvotes: 1

Related Questions