I'll make a guess
Dictionary values = new Dictionary()
{
{"Name","Joe"},{"Id",123}
};
var test = GetObject(values);
class TestClass
{
public string Name { get; set; }
public int Id { get; set; }
}
T GetObject(Dictionary 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;
}