ExtensionDataAttribute Class
Definition
- Namespace
- Bodu.Text.Serialization
- Assembly
- Bodu.Text.Serialization.dll
- Package
- Bodu.Text.Serialization 1.3.0
Designates a property or field that captures dictionary entries which do not map to any other member during deserialization, and whose entries are written back out during serialization.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class ExtensionDataAttribute : SerializationAttribute
- Inheritance
-
ExtensionDataAttribute
- Attributes
-
System.AttributeUsageAttribute
- Inherited Members
- Extension Methods
Remarks
The member must be a dictionary-shaped type keyed by string, and the accepted types differ by
serializer. For Bencode and TOML it is the format's object node type (BencodeObject or TomlObject), or
an IDictionary<TKey, TValue> or
Dictionary<TKey, TValue> whose value is the format's node type. For YAML
it is any type that implements IDictionary<string, object?>, such as
Dictionary<string, object?>. A type may declare at most one extension-data member.
On serialization the captured entries are written alongside the type's other members.
Constructors
ExtensionDataAttribute()
Initializes a new instance of the ExtensionDataAttribute class.
public ExtensionDataAttribute()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |