Using YamlDotNet for serialization, but preserve original values
I’m using YamlDotNet to indent yaml files, and it works fine. However, when I do this, the final result also shows some changes in the values of some properties, such as:
How to Deserialize YAML Field as String in YamlDotNet When It Can Be a Scalar or Sequence?
I am working with YAML data stored in a PostgreSQL database and using YamlDotNet to deserialize it into a C# object. One of the fields, cooking_instruction, can either be a single string or a sequence of strings. I want to deserialize this field as a single string in my C# object, regardless of its format in the YAML.
yamldotnet read generic file C#
so I’m trying to read yaml files and store them in json in a database, so I can do some bulk querying of them. Trouble is – I can’t seem to be able to make a generic function that reads yaml files. I started with: