Click or drag to resize
MessagePackRuntimeDictionaryKeyTypeAttribute Class
Marks that the runtime type of keys of this dictionary should be encoded with type information for polymorphism.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    MsgPack.SerializationMessagePackRuntimeDictionaryKeyTypeAttribute

Namespace: MsgPack.Serialization
Assembly: MsgPack (in MsgPack.dll) Version: 0.6.0
Syntax
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field)]
public sealed class MessagePackRuntimeDictionaryKeyTypeAttribute : Attribute

The MessagePackRuntimeDictionaryKeyTypeAttribute type exposes the following members.

Constructors
  NameDescription
Public methodMessagePackRuntimeDictionaryKeyTypeAttribute
Initializes a new instance of the MessagePackRuntimeDictionaryKeyTypeAttribute class.
Top
Remarks
When you apply this attribute to a member, the keys of the dictionary will be serialized with .NET specific type information, so deserializer will be able to deserialize object which is actual type when serialized instead of interoperability. Because non-.NET enviroments (Java, Ruby, Go, etc.) cannot interpret .NET native type identifier, you should not use this attribute when the serialized stream will be possible to be used from non-.NET environment. The typed object will be encoded as 2 elements array as follows, so your deserializer can skip type information as needed: [ <type-info>, <actual-value (array or map)>] In this point, type-info will be encoded as compressed assembly qualified name as follows: [ <compressed type full name>, <assembly simple name>, <version binary>, <culture string>, <public key token binary>] If the type full name starts with its assembly simple name, then the prefix matched to assembly simple name will be omitted (as a result, compressed type name starts with dot).
Note Note
You should use this attribute CAREFULLY when you deserialize data from outside, because this feature can inject arbitary process in your code through constructor and some virtual methods if exist. It is highly recommended avoid using Object type as member's declaring type, you should specify your base class which and derived typed are fully controled under your organization instead. It mitigate chance of potential exploits.
See Also