MsgPack.Serialization.MessagePackKnownDictionaryKeyTypeAttribute Class Reference

Marks that the runtime type of keys of this dictionary should be encoded with closed type codes for polymorphism. More...

Inherits Attribute, and MsgPack.Serialization.Polymorphic.IPolymorphicKnownTypeAttribute.

Public Member Functions

 MessagePackKnownDictionaryKeyTypeAttribute (string typeCode, Type bindingType)
 Initializes a new instance of the MessagePackKnownDictionaryKeyTypeAttribute class. More...
 

Properties

string TypeCode [get]
 Gets a type code to be bound. More...
 
Type BindingType [get]
 Gets the type of the binding Type for TypeCode. More...
 

Detailed Description

Marks that the runtime type of keys of this dictionary should be encoded with closed type codes for polymorphism.

When you apply this attribute to a member, the keys of the dictionary will be serialized as 2 element array as [ <type-code>, <actual-value (array or map)>] format where the type-code is utf-8 encoded string representing type in your application (system) context. When you interop with other launages, the deserializer will be able to deserialize object which is actual type when serialized with interoperability. <note> You must use one-to-one relationship between type-code and the type. </note>

Constructor & Destructor Documentation

◆ MessagePackKnownDictionaryKeyTypeAttribute()

MsgPack.Serialization.MessagePackKnownDictionaryKeyTypeAttribute.MessagePackKnownDictionaryKeyTypeAttribute ( string  typeCode,
Type  bindingType 
)

Initializes a new instance of the MessagePackKnownDictionaryKeyTypeAttribute class.

Parameters
typeCodeA string type code to be bound.
bindingTypeThe binding Type for typeCode .

Property Documentation

◆ BindingType

Type MsgPack.Serialization.MessagePackKnownDictionaryKeyTypeAttribute.BindingType
get

Gets the type of the binding Type for TypeCode.

The binding Type for TypeCode.

◆ TypeCode

string MsgPack.Serialization.MessagePackKnownDictionaryKeyTypeAttribute.TypeCode
get

Gets a type code to be bound.

A type code to be bound.


The documentation for this class was generated from the following file:
  • MsgPackSources/Serialization/MessagePackKnownTypeAttributes.cs