Each map field generates a read-only property of type Google.Protobuf.Collections.MapField<TKey, TValue> where TKey is the field's key type and TValue is the field's value type. For the most part, this acts like Dictionary<TKey, TValue>, but it has an additional Add overload to allow another dictionary to be added in one go. This is convenient when populating a repeated field in an object initializer. Additionally, MapField<TKey, TValue> has direct support for serialization, deserialization and cloning, but this is usually used by generated code instead of manually-written application code. Keys in the map are not permitted to be null; values may be if the corresponding singular field type would support null values.
Null values are not permitted in the map, either for wrapper types or regular messages. If a map is deserialized from a data stream and the value is missing from an entry, a default value is created instead. For primitive types, that is the regular default value (0, the empty string and so on); for message types, an empty instance of the message is created, as if the map entry contained a 0-length encoded value for the field.
My question is: Can the value in MapFields be null or not? The generated implementation prohibits it but I want to make sure that it is the case.
Thanks
Tung
My apologies if someone else have already posted the same question. I was unable to search for an topic about this.