[C #] How to create a dynamic object
1 min readJan 30, 2017
Sometimes very typed languages end up disrupting us rather than helping. Creating each property with its specific type inside a class for example, when would it be easier to simply do as you do with : object.newVariable= “hello”
Fortunately C # has a type that allows us to dynamically create objects when appropriate.
Just initialize the object with the class of type ExpandoObject and say that the variable is of type dynamic and ready.
See in Example: