I would like to pass an array of strings to an object and have the object
members built using the array items as property names. How would I go about
doing this?
Example:
public class myDynamicObject
{
public myDynamicObject (string[] memberNames)
{
foreach (string s in memberNames)
{
//make s a public property of the object
//assign a value to s
}
}
}
Many thanks!
neil
members built using the array items as property names. How would I go about
doing this?
Example:
public class myDynamicObject
{
public myDynamicObject (string[] memberNames)
{
foreach (string s in memberNames)
{
//make s a public property of the object
//assign a value to s
}
}
}
Many thanks!
neil
Comment