If some field or submessage in IMessage has IsOptional property set o true, how to check if it was specified or not?
pbMsg.DescriptorForType.FindFieldByName("some_field_name").IsOptional == true
Cause if it is not, then accessing it or its subfields (or submessages) causes an exception.
Use
pbMsg.HasField(...). Here’s what the Object Browser documentation fromIMessage.HasField(...)says about this method:Please note that this is using the protobuf-csharp library.