Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Tag Archive for ‘C# ExpandoObject’

Dynamic ExpandoObject in C#

Fig 1. Create Expando Object

In the previous article, we learned about Anonymous Type to define properties at runtime. But these properties are read only and the type will not allow changing it after creation. C# provides a class called DynamicExpando which will also allow adding the properties at runtime. But we can read and write the property values at runtime with this object. Since the type allow adding the members on the fly, the compiler will not perform any type checking. We can also…

Continue Reading →