TomlSourceGenerationOptionsAttribute Class

Specifies default source generation options for a TomlSerializerContext.

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

Constructors

NameDescription
TomlSourceGenerationOptionsAttribute()

TomlSourceGenerationOptionsAttribute()

public TomlSourceGenerationOptionsAttribute()

No documentation is available.

Properties

NameDescription
ConvertersGets or sets converter types to register on the generated context.
DefaultIgnoreConditionGets or sets the default ignore condition for null/default values.
DictionaryKeyPolicyGets or sets the policy used to convert dictionary keys during serialization.
DottedKeyHandlingGets or sets behavior for dictionary keys containing '.'.
DuplicateKeyHandlingGets or sets behavior when duplicate keys are encountered while reading.
IgnoreReadOnlyFieldsGets or sets a value indicating whether read-only fields are ignored during serialization.
IgnoreReadOnlyPropertiesGets or sets a value indicating whether read-only properties are ignored during serialization.
IncludeFieldsGets or sets a value indicating whether public fields are included during serialization and deserialization.
IndentSizeGets or sets the number of spaces to use when indentation is enabled.
InlineTablePolicyGets or sets inline table emission policy.
MappingOrderGets or sets member ordering behavior for emitted mappings.
MaxDepthGets or sets the maximum depth allowed when reading or writing nested TOML containers.
NewLineGets or sets the newline kind used by the writer.
PreferredObjectCreationHandlingGets or sets the preferred object creation handling when deserializing object and collection members.
PropertyNameCaseInsensitiveGets or sets a value indicating whether property name matching is case-insensitive.
PropertyNamingPolicyGets or sets the policy used to convert CLR property names.
RespectNullableAnnotationsGets or sets a value indicating whether nullable annotations are enforced during serialization and deserialization.
RespectRequiredConstructorParametersGets or sets a value indicating whether required constructor parameters must be present during deserialization.
RootValueHandlingGets or sets behavior for scalar/array roots that do not naturally map to a TOML document.
RootValueKeyNameGets or sets the root key name used when wrapping a scalar/array root.
TableArrayStyleGets or sets array-of-table emission style.
UnmappedMemberHandlingGets or sets how unmapped TOML keys are handled during object deserialization.
WriteIndentedGets or sets a value indicating whether output should be indented.

Gets or sets converter types to register on the generated context.

public Type[]? Converters { get; set; }

Property value

Type[]?

Remarks

Converter types must have a public parameterless constructor.

Gets or sets the default ignore condition for null/default values.

public TomlIgnoreCondition DefaultIgnoreCondition { get; set; }

Property value

TomlIgnoreCondition

Gets or sets the policy used to convert dictionary keys during serialization.

public TomlKnownNamingPolicy DictionaryKeyPolicy { get; set; }

Property value

TomlKnownNamingPolicy

Gets or sets behavior for dictionary keys containing '.'.

public TomlDottedKeyHandling DottedKeyHandling { get; set; }

Property value

TomlDottedKeyHandling

Gets or sets behavior when duplicate keys are encountered while reading.

public TomlDuplicateKeyHandling DuplicateKeyHandling { get; set; }

Gets or sets a value indicating whether read-only fields are ignored during serialization.

public bool IgnoreReadOnlyFields { get; set; }

Property value

bool

Gets or sets a value indicating whether read-only properties are ignored during serialization.

public bool IgnoreReadOnlyProperties { get; set; }

Property value

bool

Gets or sets a value indicating whether public fields are included during serialization and deserialization.

public bool IncludeFields { get; set; }

Property value

bool

Gets or sets the number of spaces to use when indentation is enabled.

public int IndentSize { get; set; }

Property value

int

Gets or sets inline table emission policy.

public TomlInlineTablePolicy InlineTablePolicy { get; set; }

Property value

TomlInlineTablePolicy

Gets or sets member ordering behavior for emitted mappings.

public TomlMappingOrderPolicy MappingOrder { get; set; }

Gets or sets the maximum depth allowed when reading or writing nested TOML containers.

public int MaxDepth { get; set; }

Property value

int

Gets or sets the newline kind used by the writer.

public TomlNewLineKind NewLine { get; set; }

Property value

TomlNewLineKind

PreferredObjectCreationHandling

TomlSourceGenerationOptionsAttribute.cs

Gets or sets the preferred object creation handling when deserializing object and collection members.

public TomlObjectCreationHandling PreferredObjectCreationHandling { get; set; }

PropertyNameCaseInsensitive

TomlSourceGenerationOptionsAttribute.cs

Gets or sets a value indicating whether property name matching is case-insensitive.

public bool PropertyNameCaseInsensitive { get; set; }

Property value

bool

Gets or sets the policy used to convert CLR property names.

public TomlKnownNamingPolicy PropertyNamingPolicy { get; set; }

Property value

TomlKnownNamingPolicy

RespectNullableAnnotations

TomlSourceGenerationOptionsAttribute.cs

Gets or sets a value indicating whether nullable annotations are enforced during serialization and deserialization.

public bool RespectNullableAnnotations { get; set; }

Property value

bool

Remarks

The default is true when the property is not set.

RespectRequiredConstructorParameters

TomlSourceGenerationOptionsAttribute.cs

Gets or sets a value indicating whether required constructor parameters must be present during deserialization.

public bool RespectRequiredConstructorParameters { get; set; }

Property value

bool

Remarks

The default is true when the property is not set.

Gets or sets behavior for scalar/array roots that do not naturally map to a TOML document.

public TomlRootValueHandling RootValueHandling { get; set; }

Property value

TomlRootValueHandling

Gets or sets the root key name used when wrapping a scalar/array root.

public string? RootValueKeyName { get; set; }

Property value

string?

Gets or sets array-of-table emission style.

public TomlTableArrayStyle TableArrayStyle { get; set; }

Property value

TomlTableArrayStyle

Gets or sets how unmapped TOML keys are handled during object deserialization.

public TomlUnmappedMemberHandling UnmappedMemberHandling { get; set; }

Gets or sets a value indicating whether output should be indented.

public bool WriteIndented { get; set; }

Property value

bool