I want to parse yaml in c# in such a way that I get a List of Hashtables. I'm using YamlDotNet. Here is my code:
TextReader tr = new StringReader(txtRawData.Text);
var reader = new EventReader(new MergingParser(new Parser(tr)));
Deserializer des = new Deserializer(); ;
var result = des.Deserialize<List<Hashtable>>(tr);
It does not fail but gives me a null object.
My yaml is like:
- Label: entry
Layer: x
id: B35E246039E1CB70
- Ref: B35E246039E1CB70
Label: Info
Layer: x
id: CE0BEFC7022283A6
- Ref: CE0BEFC7022283A6
Label: entry
Layer: HttpWebRequest
id: 6DAA24FF5B777506
How do I parse my yaml and convert it to the desired type without having to implement it on my own?