YamlEnumMemberNameAttribute Class
Specifies the YAML scalar used to represent an enum member.
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class YamlEnumMemberNameAttribute : YamlAttributeRemarks
This is the YAML equivalent of System.Text.Json.Serialization.JsonStringEnumMemberNameAttribute. Apply it to an enum field to override the name emitted and accepted for that value.
- Inheritance
YamlAttributeYamlEnumMemberNameAttribute
Constructors
| Name | Description |
|---|---|
| YamlEnumMemberNameAttribute(string) | Initializes a new instance of the YamlEnumMemberNameAttribute class. |
YamlEnumMemberNameAttribute(string)
YamlEnumMemberNameAttribute.csInitializes a new instance of the YamlEnumMemberNameAttribute class.
public YamlEnumMemberNameAttribute(string name)Parameters
namestring- The YAML scalar used to represent the enum member.
Exceptions
ArgumentNullExceptionnameisnull.
Properties
| Name | Description |
|---|---|
| Name | Gets the YAML scalar used to represent the enum member. |