YamlUnionCaseInfo class
Represents metadata for a single case type within a union type.
Namespace: System.Text.Yaml.Serialization.Metadata ยท Assembly: Styml.dll
public sealed class YamlUnionCaseInfo
Represents metadata for a single case type within a union type.
ConstructorsLink to this heading
Initializes a new instance of YamlUnionCaseInfo with the specified case type.
public YamlUnionCaseInfo(Type caseType);
Parameters
caseType: The type representing this union case.
| Exception | Condition |
|---|---|
| ArgumentNullException | caseType is null. |
PropertiesLink to this heading
CaseTypeLink to this heading
Gets the type representing this union case.
public Type CaseType { get; }
IsNullableLink to this heading
Gets a value indicating whether this case can hold a null value.
public bool IsNullable { get; init; }
Set to true when the union constructor parameter for this case was declared as a nullable reference type or as Nullable<T>. When a YAML null is encountered during deserialization, the first union case whose YamlUnionCaseInfo.IsNullable is true is selected and its case constructor is invoked with null.