So, I would like to treat -1, "" and NaN as null values when serializing some fields in a protobuffer. This is to deal with legacy code. Right now I'm populating the a protobuffer based on a C# object I'm provided, and a number of the properties have these values which indicate a kind of null
value. I'd like very much not to have write and maintain a ton of if
checks to see if the field holds one of these so called null
values.
Is there some kind of .NET protobuffer serialization option that would silently treat these values and null and not serialize them?
For clarity this is .NET 4.5 with protoc 2.6.1.