DefaultYamlTypeInfoResolver class
Defines the default, reflection-based YAML contract resolver used by System.Text.Yaml.
Namespace: System.Text.Yaml.Serialization.Metadata ยท Assembly: Styml.dll
public class DefaultYamlTypeInfoResolver : IYamlTypeInfoResolver
Implements: IYamlTypeInfoResolver
Defines the default, reflection-based YAML contract resolver used by System.Text.Yaml.
RemarksLink to this heading
The contract resolver used by YamlSerializerOptions.Default.
ConstructorsLink to this heading
Creates a mutable DefaultYamlTypeInfoResolver instance.
public DefaultYamlTypeInfoResolver();
PropertiesLink to this heading
ModifiersLink to this heading
Gets a list of user-defined callbacks that can be used to modify the initial contract.
public IList<Action<YamlTypeInfo>> Modifiers { get; }
The modifier list will be rendered immutable after the first DefaultYamlTypeInfoResolver.GetTypeInfo invocation. Modifier callbacks are called consecutively in the order in which they are specified in the list.
MethodsLink to this heading
GetTypeInfoLink to this heading
Resolves a YAML contract for a given type and options configuration.
public virtual YamlTypeInfo GetTypeInfo(Type type, YamlSerializerOptions options);
Parameters
type: The type for which to resolve a YAML contract.options: AYamlSerializerOptionsinstance used to determine contract configuration.
Returns: A YamlTypeInfo defining a reflection-derived YAML contract for type.
| Exception | Condition |
|---|---|
| ArgumentNullException | type or options is null. |
The base implementation of this method will produce a reflection-derived contract and apply any callbacks from the DefaultYamlTypeInfoResolver.Modifiers list.