Using protobuf-net, instead of iterating through each ShouldSerialize*(), how do I determine which oneof is set? I see that ShouldSerialize*() uses this internally __pbn__message.Is(7) but that private property is not accessible, and I also don't know how to get the max field number?
Trying to avoid iterating through each ShouldSerialize*() method because then when a new type is added, we'd need to update the iteration too.
Similar question but solved using Google's Nuget package instead: Getting all field names from a protocol buffer?