I’m trying to insert properties dynamically to a class.
I need to load properties from database and show it in PropertyGrid, but I want to it to be build in run time, it means that I want to insert property definition to database and to load it to a class(My Class) in runtime.
e.g – if the data base contains row that define property (e.g Name of type string)
the class should something like this:
public MyClass
{
public string Name{get; set;}
}
I also tried to do it using dynamic but it failed.
any ideas?
Thank you.
You can use an ExpandoObject.