YamlTypeInfo Class
Represents metadata and operations for a serializable type.
public abstract class YamlTypeInfoConstructors
| Name | Description |
|---|---|
| YamlTypeInfo(Type, YamlSerializerOptions) | Initializes a new instance of the YamlTypeInfo class. |
YamlTypeInfo(Type, YamlSerializerOptions)
YamlTypeInfo.csInitializes a new instance of the YamlTypeInfo class.
protected YamlTypeInfo(Type type, YamlSerializerOptions options)Parameters
typeType- The represented CLR type.
optionsYamlSerializerOptions- The options associated with the metadata.
Exceptions
ArgumentNullExceptiontypeoroptionsisnull.
Properties
| Name | Description |
|---|---|
| Options | Gets the options associated with this metadata instance. |
| Type | Gets the CLR type represented by this metadata. |
Options
YamlTypeInfo.csGets the options associated with this metadata instance.
public YamlSerializerOptions Options { get; }Property value
Type
YamlTypeInfo.csMethods
| Name | Description |
|---|---|
| ReadAsObject(YamlReader) | Reads a value from an existing YAML reader. |
| Write(YamlWriter, object?) | Writes a value to an existing YAML writer. |
ReadAsObject(YamlReader)
Reads a value from an existing YAML reader.
public abstract object? ReadAsObject(YamlReader reader)Parameters
readerYamlReader- The reader positioned on the value token.
Returns
object? The deserialized value.
Write(YamlWriter, object?)
Writes a value to an existing YAML writer.
public abstract void Write(YamlWriter writer, object? value)Parameters
writerYamlWriter- The writer that receives the value payload.
valueobject?- The value to serialize.
Exceptions
ArgumentNullExceptionwriterisnull.