I'm using YamlDotNet Nuget-package to read and write a Yaml file in C#/.Net Framework. While writing yaml file, it creates 3 dots at end of file. Since these dots are optional so I don't want them. Is there a way to exclude them while creating yaml file? This is my code.
using YamlDotNet.RepresentationModel;
var input = new StreamReader(Constants.YamlFilePath);
var yaml = new YamlStream();
yaml.Load(input);
input.Dispose();
var config = ((YamlMappingNode)yaml.Documents[0].RootNode).Children["Configuration"];
((YamlMappingNode)yaml.Documents[0].RootNode).Children["Configuration"] = new YamlMappingNode
{
{ "A1", data.A1 },
{ "A2", data.A2 },
{ "A3", data.A3 },
{ "A4", config["A4"].ToString() },
{ "A5", config["A5"].ToString() }
};
using (StreamWriter writer = new StreamWriter(Constants.YamlFilePath, false))
yaml.Save(writer);