PortableTypeYamlConverter
YAML type converter for PortableType discriminated union. Serializes types as simple strings like "Text", "Int", "VarChar(255)".
public sealed class PortableTypeYamlConverter : IYamlTypeConverter
Methods
Accepts(Type)
public bool Accepts(Type type)
Gets a value indicating whether the current converter supports converting the specified type.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
Type |
Returns: Boolean
ReadYaml(IParser, Type, ObjectDeserializer)
public object? ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer)
Reads an object's state from a YAML parser.
Parameters:
| Name | Type | Description |
|---|---|---|
parser |
IParser |
|
type |
Type |
|
rootDeserializer |
ObjectDeserializer |
Returns: Object
WriteYaml(IEmitter, object?, Type, ObjectSerializer)
public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializer serializer)
Writes the specified object's state to a YAML emitter.
Parameters:
| Name | Type | Description |
|---|---|---|
emitter |
IEmitter |
|
value |
Object |
|
type |
Type |
|
serializer |
ObjectSerializer |