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:

  • email
  • 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

Popular posts from this blog

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

php - I want to create a website for polls/survey like this http://www.poll-maker.com/ -