TomlDerivedTypeMappingAttribute Class
Registers a derived type mapping on a source-generated TomlSerializerContext, enabling cross-project polymorphism.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class TomlDerivedTypeMappingAttribute : TomlAttribute- Inheritance
TomlAttributeTomlDerivedTypeMappingAttribute
Constructors
| Name | Description |
|---|---|
| TomlDerivedTypeMappingAttribute(Type, Type) | Initializes a new instance of the TomlDerivedTypeMappingAttribute class with no discriminator. |
| TomlDerivedTypeMappingAttribute(Type, Type, int) | Initializes a new instance of the TomlDerivedTypeMappingAttribute class with an integer discriminator. |
| TomlDerivedTypeMappingAttribute(Type, Type, string) | Initializes a new instance of the TomlDerivedTypeMappingAttribute class with a string discriminator. |
TomlDerivedTypeMappingAttribute overloads
TomlDerivedTypeMappingAttribute(Type, Type)
TomlDerivedTypeMappingAttribute.csInitializes a new instance of the TomlDerivedTypeMappingAttribute class with no discriminator.
TomlDerivedTypeMappingAttribute(Type, Type, int)
TomlDerivedTypeMappingAttribute.csInitializes a new instance of the TomlDerivedTypeMappingAttribute class with an integer discriminator.
TomlDerivedTypeMappingAttribute(Type, Type, string)
TomlDerivedTypeMappingAttribute.csInitializes a new instance of the TomlDerivedTypeMappingAttribute class with a string discriminator.
Properties
| Name | Description |
|---|---|
| BaseType | Gets the polymorphic base type. |
| DerivedType | Gets the derived CLR type. |
| Discriminator | Gets the discriminator value, or null when this is the default derived type. |