Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 282
Hermann.Gruber Avatar asked Mar 13 '26 16:03

Hermann.Gruber


1 Answers

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

like image 80
Marc Gravell Avatar answered Mar 16 '26 05:03

Marc Gravell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!