What the best way convert this dictionary:
Dictionary<string, object> person = new Dictionary<string, object>();
person.Add("ID", 1);
person.Add("Name", "Alex");
to object:
public class Person
{
public int ID{get;set;}
public string Name{get;set;}
}
?
If you want to be able to do this for any object in general, you could use reflection. Assuming the values in the dictionary are the appropriate type and requires no conversion:
Then to use it: