TryDeserialize(Stream, Type, YamlSerializerContext, out Object?) Method

Definition

Namespace SharpYaml
Assembly SharpYaml.dll

Attempts to deserialize YAML from a stream using UTF-8 encoding and an explicit destination type using generated metadata from a serializer context.

public static bool TryDeserialize(Stream utf8Stream, Type returnType, YamlSerializerContext context, scoped out object? value)

Parameters

utf8Stream
Stream

The source stream.

returnType
Type

The destination CLR type.

context
YamlSerializerContext

The source-generated serializer context.

value
Object

The deserialized value when successful; otherwise null.

Returns

Boolean
true when deserialization succeeded; otherwise false.