TomlPolymorphicAttribute Class

Marks a base type as polymorphic for TOML serialization.

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public sealed class TomlPolymorphicAttribute : TomlAttribute
Inheritance
TomlAttribute TomlPolymorphicAttribute

Constructors

NameDescription
TomlPolymorphicAttribute()

TomlPolymorphicAttribute()

TomlPolymorphicAttribute.cs
public TomlPolymorphicAttribute()

No documentation is available.

Properties

NameDescription
TypeDiscriminatorPropertyNameGets or sets the discriminator property name.
UnknownDerivedTypeHandlingGets or sets the behavior when an unknown discriminator is encountered. When set to a value other than TomlUnknownDerivedTypeHandling.Unspecified, this overrides the global TomlPolymorphismOptions.UnknownDerivedTypeHandling.

TypeDiscriminatorPropertyName

TomlPolymorphicAttribute.cs

Gets or sets the discriminator property name.

public string? TypeDiscriminatorPropertyName { get; set; }

Property value

string?

UnknownDerivedTypeHandling

TomlPolymorphicAttribute.cs

Gets or sets the behavior when an unknown discriminator is encountered. When set to a value other than TomlUnknownDerivedTypeHandling.Unspecified, this overrides the global TomlPolymorphismOptions.UnknownDerivedTypeHandling.

public TomlUnknownDerivedTypeHandling UnknownDerivedTypeHandling { get; set; }