Questions tagged «dynamic-class-creation»

13
如何动态创建类?
我有一堂课,看起来像这样: public class Field { public string FieldName; public string FieldType; } 还有一个List<Field>带有值的对象: {"EmployeeID","int"}, {"EmployeeName","String"}, {"Designation","String"} 我想创建一个看起来像这样的类: Class DynamicClass { int EmployeeID, String EmployeeName, String Designation } 有什么办法吗? 我希望这在运行时生成。我不希望文件系统中存在物理CS文件。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.