How to add property in a class on run time and when I run the code
ClassName.GetType().GetProperties();
it will give me the name of property which i have added.
How to add property in a class on run time and when I run the code
ClassName.GetType().GetProperties();
it will give me the name of property which i have added.
You can use Expando Objects. They allow to add and remove properties on run time.
The ExpandoObject class belongs to the System.Dynamic namespace and is defined in the System.Core assembly. ExpandoObject represents an object whose members can be dynamically added and removed at run time. The class is sealed