# YamlConverter<T>

Reads and writes values of T.

Class 

`OfficeIMO.Yaml`

**Namespace**

`OfficeIMO.Yaml`

**Assembly**

`OfficeIMO.Yaml`

**Source revision**

`78706d0f9c0e` with working tree changes

**Source**

[YamlConverter.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/78706d0f9c0ecb8c19bb788cfda578b014be7948/Sources/OfficeIMO.Yaml/Serialization/YamlConverter.cs#L33)

**Base**

`YamlConverter`

**Modifiers**

abstract

Reads and writes values of T. Reading hands the converter each non-null value as a detached node, with aliases expanded; writing hands it a writer positioned where the value goes, for exactly one node. A null scalar reads as the default of T, and a null value writes as a null scalar, without asking the converter.

## Inheritance

- [YamlConverter](/api/yaml/officeimo-yaml-yamlconverter/)
- YamlConverter<T>

## Derived Types

- [YamlConverter<T>](/api/yaml/officeimo-yaml-yamlconverter-1/)

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [YamlSerializerOptions.Converters](/api/yaml/officeimo-yaml-yamlserializeroptions/#property-converters)

## Type Parameters

**T**

The type the converter handles.

Filter members 

Show inherited

## Methods

`public abstract T? Read(YamlNode node, YamlSerializerOptions options)` [#](#method-read-officeimo-yaml-yamlnode-officeimo-yaml-yamlserializeroptions)

Reads a value from its node.

Parameters

**node OfficeIMO.Yaml.YamlNode required**

The value's node: a scalar, mapping or sequence that belongs to no document.

**options OfficeIMO.Yaml.YamlSerializerOptions required**

The options the serializer runs with.

Returns

`T?`

`public abstract void Write(YamlWriter writer, T? value, YamlSerializerOptions options)` [#](#method-write-officeimo-yaml-yamlwriter-officeimo-yaml-yamlserializeroptions)

Writes a non-null value as one node: a scalar, or a mapping or sequence with everything inside it.

Parameters

**writer OfficeIMO.Yaml.YamlWriter required**

The writer, positioned where the value goes.

**value T? required**

The value.

**options OfficeIMO.Yaml.YamlSerializerOptions required**

The options the serializer runs with.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public override sealed Type Type { get; }` [#](#property-type)

[YamlConverter.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/78706d0f9c0ecb8c19bb788cfda578b014be7948/Sources/OfficeIMO.Yaml/Serialization/YamlConverter.cs#L33)

Gets the type whose values the converter reads and writes.

<!-- PowerForge markdown artifact sha256:66F10709E03963EBEA9E2F617CBFDDDCBC4A41C2EB42F445851880F7498415D5 -->
