Is there a way to add a property to an ExpandoObject with the same name as a string value?
For example, if I have:
string propName = "ProductNumber";
dynamic obj = new System.Dynamic.ExpandoObject();
I can create the property ProductNumber like:
obj.ProductNumber = 123;
But, can I create the property obj.ProductNumber
based on the string propName
? So, if I don't know what the name of the property will be in advanced, I can create it based on this input. If this is not possible with ExpandoObject, any other areas of C# I should look into?