YamlPolymorphismOptions class
Defines polymorphic configuration for a specified base type.
Namespace: System.Text.Yaml.Serialization.Metadata ยท Assembly: Styml.dll
public class YamlPolymorphismOptions
Defines polymorphic configuration for a specified base type.
ConstructorsLink to this heading
Creates an empty YamlPolymorphismOptions instance.
public YamlPolymorphismOptions();
PropertiesLink to this heading
DerivedTypesLink to this heading
Gets the list of derived types supported in the current polymorphic type configuration.
public IList<YamlDerivedType> DerivedTypes { get; }
DiscriminatorStyleLink to this heading
Gets or sets how a value says which derived type it is: the $type property (the default), a YAML tag, or both (YamlTypeDiscriminatorStyle).
public YamlTypeDiscriminatorStyle DiscriminatorStyle { get; set; }
| Exception | Condition |
|---|---|
| InvalidOperationException | The parent YamlTypeInfo instance has been locked for further modification. |
IgnoreUnrecognizedTypeDiscriminatorsLink to this heading
When set to true, instructs the serializer to ignore any unrecognized type discriminator id's and reverts to the contract of the base type. Otherwise, it will fail the deserialization.
public bool IgnoreUnrecognizedTypeDiscriminators { get; set; }
| Exception | Condition |
|---|---|
| InvalidOperationException | The parent YamlTypeInfo instance has been locked for further modification. |
TypeDiscriminatorPropertyNameLink to this heading
Gets or sets a custom type discriminator property name for the polymorhic type. Uses the default '$type' property name if left unset.
public string TypeDiscriminatorPropertyName { get; set; }
| Exception | Condition |
|---|---|
| InvalidOperationException | The parent YamlTypeInfo instance has been locked for further modification. |
UnknownDerivedTypeHandlingLink to this heading
Gets or sets the behavior when serializing an undeclared derived runtime type.
public YamlUnknownDerivedTypeHandling UnknownDerivedTypeHandling { get; set; }
| Exception | Condition |
|---|---|
| InvalidOperationException | The parent YamlTypeInfo instance has been locked for further modification. |