YamlParameterInfo class
Provides YAML serialization-related metadata about a constructor parameter.
Namespace: System.Text.Yaml.Serialization.Metadata ยท Assembly: Styml.dll
public abstract class YamlParameterInfo
Provides YAML serialization-related metadata about a constructor parameter.
PropertiesLink to this heading
AttributeProviderLink to this heading
Gets a custom attribute provider for the current parameter.
public ICustomAttributeProvider? AttributeProvider { get; }
When resolving metadata via the built-in resolvers this will be populated with the underlying ParameterInfo of the constructor metadata.
DeclaringTypeLink to this heading
Gets the declaring type of the constructor.
public Type DeclaringType { get; }
DefaultValueLink to this heading
Gets a value indicating the default value if the parameter has a default value.
public object? DefaultValue { get; }
HasDefaultValueLink to this heading
Gets a value indicating whether the parameter has a default value.
public bool HasDefaultValue { get; }
IsMemberInitializerLink to this heading
Gets a value indicating whether the parameter represents a required or init-only member initializer.
public bool IsMemberInitializer { get; }
Only returns true for source generated metadata which can only access required or init-only member initializers using object initialize expressions.
IsNullableLink to this heading
Gets a value indicating whether the constructor parameter is annotated as nullable.
public bool IsNullable { get; }
Contracts originating from DefaultYamlTypeInfoResolver or YamlSerializerContext, derive the value of this parameter from nullable reference type annotations, including annotations from attributes such as AllowNullAttribute or DisallowNullAttribute. This property has no effect on deserialization unless the YamlSerializerOptions.RespectNullableAnnotations property has been enabled, in which case the serializer will reject any null deserialization results. This setting is in sync with the associated YamlPropertyInfo.IsSetNullable property.
NameLink to this heading
Gets the name of the parameter.
public string Name { get; }
ParameterTypeLink to this heading
Gets the type of this parameter.
public Type ParameterType { get; }
PositionLink to this heading
Gets the zero-based position of the parameter in the formal parameter list.
public int Position { get; }