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

Definition

Namespace SharpYaml
Assembly SharpYaml.dll

Attempts to deserialize a YAML payload into an explicit destination type.

public static bool TryDeserialize(string yaml, Type returnType, scoped out object? value, YamlSerializerOptions? options = null)

Parameters

yaml
String

The YAML payload.

returnType
Type

The destination CLR type.

value
Object

The deserialized value when successful; otherwise null.

options
YamlSerializerOptions

The serializer options. If null, Default is used.

Returns

Boolean
true when deserialization succeeded; otherwise false.