I have an empty class.
public class Item
{
//empty
}
I need to add properties to this class dynamically from PropertyInfo
objects.
List<PropertyInfo> propertyInfo = Util.GetProperties();
Finally after adding properties, the class should be like:
public class Item
{
//dynamically added properties
public string Name {get;set;}
public string Description{get;set;}
}
And I need to access the property from the class opbect like:
var item = new Item();
var name = item.Name;
Is this possible in c#? How can I implement this? Can I implement Property Changed notification to dynamically added properties?