YamlExtensionDataAttribute class
When placed on a property or field of type YamlObject, IDictionary<T, T2>, or IReadOnlyDictionary<T, T2>, any properties that do not have a matching property or field are added during deserialization and written during serialization.
Namespace: System.Text.Yaml.Serialization ยท Assembly: Styml.dll
public sealed class YamlExtensionDataAttribute : YamlAttribute
Inheritance: object โ Attribute โ YamlAttribute โ YamlExtensionDataAttribute
When placed on a property or field of type YamlObject, IDictionary<T, T2>, or IReadOnlyDictionary<T, T2>, any properties that do not have a matching property or field are added during deserialization and written during serialization.
RemarksLink to this heading
When using IDictionary<T, T2> or IReadOnlyDictionary<T, T2>, the TKey value must be String and TValue must be YamlElement or Object. During deserializing with a IDictionary<T, T2> extension property with TValue as Object, the type of object created will either be a YamlNode or a YamlElement depending on the value of YamlSerializerOptions.UnknownTypeHandling. If a YamlElement is created, a "null" YAML value is treated as a YamlElement with YamlElement.ValueKind set to YamlValueKind.Null, otherwise a "null" YAML value is treated as a null object reference. During serializing, the name of the extension data member is not included in the YAML; the data contained within the extension data is serialized as properties of the YAML object. If there is more than one extension member on a type, or the member is not of the correct type, an InvalidOperationException is thrown during the first serialization or deserialization of that type.
ConstructorsLink to this heading
public YamlExtensionDataAttribute();