I'll make a guess
Dictionary<string, object> values = new Dictionary<string, object>()
{
{"Name","Joe"},{"Id",123}
};
var test = GetObject<TestClass>(values);
class TestClass
{
public string Name { get; set; }
public int Id { get; set; }
}
T GetObject<T>(Dictionary<string,object> dict)
{
Type type = typeof(T);
var obj = Activator.CreateInstance(type);
foreach (var kv in dict)
{
type.GetProperty(kv.Key).SetValue(obj, kv.Value);
}
return (T)obj;
}