TomlSerializableAttribute Class

Specifies a root type to include in a source-generated TomlSerializerContext.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class TomlSerializableAttribute : TomlAttribute
Inheritance
TomlAttribute TomlSerializableAttribute

Constructors

NameDescription
TomlSerializableAttribute(Type)Initializes a new instance of the TomlSerializableAttribute class.

TomlSerializableAttribute(Type)

TomlSerializableAttribute.cs

Initializes a new instance of the TomlSerializableAttribute class.

public TomlSerializableAttribute(Type type)

Parameters

type Type
The root type to include in the generated context.

Properties

NameDescription
TypeGets the root type included in the generated context.
TypeInfoPropertyNameGets or sets the generated TomlTypeInfo property name for this root type.

Gets the root type included in the generated context.

public Type Type { get; }

Property value

Type

TypeInfoPropertyName

TomlSerializableAttribute.cs

Gets or sets the generated TomlTypeInfo property name for this root type.

public string? TypeInfoPropertyName { get; set; }

Property value

string?