YamlNamingPolicyAttribute Class
Specifies the naming policy used to convert the names of the annotated member or of all members of the annotated type.
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, AllowMultiple = false)]
public sealed class YamlNamingPolicyAttribute : YamlAttributeRemarks
When applied to a type, it sets the naming policy for all members declared on that type. When applied to a member, it overrides the type-level and serializer-level naming policy for that member. YamlPropertyNameAttribute takes precedence over this attribute.
- Inheritance
YamlAttributeYamlNamingPolicyAttribute
Constructors
| Name | Description |
|---|---|
| YamlNamingPolicyAttribute(YamlKnownNamingPolicy) | Initializes a new instance of the YamlNamingPolicyAttribute class. |
YamlNamingPolicyAttribute(YamlKnownNamingPolicy)
YamlNamingPolicyAttribute.csInitializes a new instance of the YamlNamingPolicyAttribute class.
public YamlNamingPolicyAttribute(YamlKnownNamingPolicy namingPolicy)Parameters
namingPolicyYamlKnownNamingPolicy- The naming policy to apply. Use
YamlKnownNamingPolicy.Unspecifiedto use the CLR names as-is.
Properties
| Name | Description |
|---|---|
| NamingPolicy | Gets the naming policy to apply. |