My business code uses dynamic properties. So I need to use some form of DynamicObject.
IMHO - I get this, but at least to me, it doesn't explain the need for casing...
In any case, this was an interesting happy hour exercise...and I think this is janky and probably should never see the light of day :)
var json = "{ \"name\": \"John\", \"age\": 55, \"fooBoo\": 0}";
JObject obj = JObject.Parse(json);
dynamic foo = new ExpandoObject();
var bar = (IDictionary<string, object>) foo;
foreach (JProperty property in obj.Properties())
{
var janky = property.Name.Substring(0, 1).ToUpperInvariant() + property.Name.Substring(1);
bar.Add(janky, property.Value);
}
Console.WriteLine($"{foo.Name} , {foo.Age}, {foo.FooBoo}");
TGIF :)