This task is trivial in Javascript but in C#, I can't find a way to do it.
I have an anonymous type containing nested anonymous types. These child types contain the property rootLength
that should ultimately be set to the value of the parent like a Global if you will.
How do I set the value of children based on the value of parent?
var opensslSettings = new
{
rootLength = 2048,
pkcs3 = new
{
rootLength = 2048,
outDir = AppDomain.CurrentDomain.BaseDirectory,
outDhp = "www_example_com_2048bit.pkcs3"
},
pkcs10 = new
{
rootLength = 2048,
outDir = AppDomain.CurrentDomain.BaseDirectory,
outKeyFile = "www_example_com_2048bit.pkcs8",
outCsrFile = "www_example_com_2048bit.pkcs10"
},
};
Console.WriteLine(opensslSettings.ToString());