TryDeserialize(String, YamlSerializerContext, out T?) Method

Definition

Namespace SharpYaml
Assembly SharpYaml.dll

Attempts to deserialize a YAML payload from text using generated metadata from a serializer context.

public static bool TryDeserialize<T>(string yaml, YamlSerializerContext context, scoped out T? value)

Type parameters

T
The destination CLR type.

Parameters

yaml
String

The YAML payload.

context
YamlSerializerContext

The source-generated serializer context.

value
{T}

The deserialized value when successful; otherwise default.

Returns

Boolean
true when deserialization succeeded; otherwise false.