Table of Contents

Class YamlSerializer

Namespace
Cuemon.Runtime.Serialization
Assembly
Cuemon.Core.dll

Provides functionality to serialize objects to YAML and to deserialize YAML into objects.

[Obsolete("All YAML marshalling has been moved to its own assembly; Cuemon.Extensions.YamlDotNet. This member will be removed with next major version.")]
public class YamlSerializer
Inheritance
Object
YamlSerializer

Constructors

YamlSerializer(YamlSerializerOptions)

Initializes a new instance of the YamlSerializer class.

public YamlSerializer(YamlSerializerOptions options)

Parameters

options YamlSerializerOptions

The configured YamlSerializerOptions.

Exceptions

ArgumentException

options are not in a valid state.

YamlSerializer(Action<YamlSerializerOptions>)

Initializes a new instance of the YamlSerializer class.

public YamlSerializer(Action<YamlSerializerOptions> setup = null)

Parameters

setup Action<YamlSerializerOptions>

The YamlSerializerOptions which may be configured.

Exceptions

ArgumentException

setup was unable to configure a valid state of the public read-write properties.

Methods

Deserialize(Stream, Type)

Deserializes the specified value into an object of objectType.

public object Deserialize(Stream value, Type objectType)

Parameters

value Stream

The object to deserialize from YAML format.

objectType Type

The type of the object to deserialize.

Returns

Object

An object of objectType.

Deserialize<T>(Stream)

Deserializes the specified value into an object of T.

public T Deserialize<T>(Stream value)

Parameters

value Stream

The object to deserialize from YAML format.

Returns

T

An object of T.

Type Parameters

T

The type of the object to deserialize.

Serialize(Object, Type)

Converts the value of a specified type into a YAML string.

public Stream Serialize(object source, Type inputType)

Parameters

source Object

The value to convert.

inputType Type

The type of the value to convert.

Returns

Stream

The YAML stream representation of the value.

Serialize<T>(T)

Converts the value of a specified type into a YAML string.

public Stream Serialize<T>(T source)

Parameters

source T

The value to convert.

Returns

Stream

The YAML stream representation of the value.

Type Parameters

T

The type of the value to serialize.