Hi I'm using YamlDotNet to deserialize a yml file like this:
name: element name
description: something to describe
parameters:
- firstKey: value1
- secondKey: value2
this is the .net class for deserialize:
class MyElement
{
public string name { get; set; }
public string description { get; set; }
public ??? parameters { get; set; }
}
which type I can use to properly deserialize the parameters property to list an array of key/value pair? And what's the better way, next, to retreive the value using the key?
this is the C# code to deserialize:
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
...
var deser = new DeserializerBuilder().WithNamingConvention(new CamelCaseNamingConvention()).Build();
var reader = File.OpenText(pathToFileYml);
var data = deser.Deserialize<MyElement>(reader);
Thanks in advance