YamlUnionCaseProperty Class

Describes a mapping key declared by a union case that serializes as a YAML mapping.

public sealed class YamlUnionCaseProperty

Constructors

NameDescription
YamlUnionCaseProperty(string, bool)Initializes a new instance of the YamlUnionCaseProperty class.

YamlUnionCaseProperty(string, bool)

YamlUnionCaseProperty.cs

Initializes a new instance of the YamlUnionCaseProperty class.

public YamlUnionCaseProperty(string name, bool isRequired)

Parameters

name string
The mapping key, after the naming policy has been applied.
isRequired bool
Whether the payload must contain the key.

Exceptions

ArgumentNullException
name is null.

Properties

NameDescription
IsRequiredGets a value indicating whether the payload must contain the key.
NameGets the mapping key, after the naming policy has been applied.

Gets a value indicating whether the payload must contain the key.

public bool IsRequired { get; }

Property value

bool

Gets the mapping key, after the naming policy has been applied.

public string Name { get; }

Property value

string