I have the following anonymous type:
new {data1 = \"test1\", data2 = \"sam\", data3 = \"bob\"}
I need a method that will take this in, and
Here is how they do it in RouteValueDictionary:
private void AddValues(object values)
{
if (values != null)
{
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(values))
{
object obj2 = descriptor.GetValue(values);
this.Add(descriptor.Name, obj2);
}
}
}
Full Source is here: http://pastebin.com/c1gQpBMG