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

Definition

Namespace SharpYaml
Assembly SharpYaml.dll

Attempts to deserialize a YAML payload into an explicit destination type using generated metadata from a serializer context.

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

Parameters

yaml
String

The YAML payload.

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.