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

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -