C#: Dynamic load a string list to be public properties of a class when app luanch -
i have class this:
public class class1 { public string firstname { get; set; } public string lastname { get; set; } }
now have string list somewhere , want load dynamically public properties of class1
when application launch, how can do?
string list like:
- telephone
- homepage
load them public properties of class1
in run time.
you can use expandoobject
.
if want have dynamic properties in addition non-dynamic properties, here article explaining how create dynamic object yourself.
Comments
Post a Comment