我有属性字典并输入为:
string className = "Class1";
var props = new Dictionary<string, Type>() {
{ "Title", typeof(string) },
{ "Text", typeof(string) },
{ "Active", typeof(bool) }
};
我想在运行时创建class1而不是硬编码: 目前我已将class1定义为:
public class Class1
{
public string Title{ get; set; }
public string Text{ get; set; }
public bool Active{ get; set; }
}