Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Text.​Json.​Serialization.​JsonPolymorphicAttribute

Assembly: System.Text.Json

Inheritance: object → AttributeJsonAttribute → JsonPolymorphicAttribute

When placed on a type, indicates that the type should be serialized polymorphically.

Properties

public bool
IgnoreUnrecognizedTypeDiscriminators
Gets or sets a value that indicates whether the deserializer should ignore any unrecognized type discriminator IDs and revert to the contract of the base type.
public string
TypeDiscriminatorPropertyName
Gets or sets a custom type discriminator property name for the polymorphic type. Uses the default '$type' property name if left unset.
UnknownDerivedTypeHandling
Gets or sets the behavior when serializing an undeclared derived runtime type.
public object
TypeId

Methods

public bool
Equals​(object obj)
Inherited from Attribute
public int
GetHashCode​()
Inherited from Attribute
public bool
IsDefaultAttribute​()
Inherited from Attribute
public bool
Match​(object obj)
Inherited from Attribute
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object