Dynamic class creation in C#

前端 未结 5 743
离开以前
离开以前 2021-01-13 10:07

Is it possible in runtime to create a class from DataTable where ColumnName will be dynamic-class properties?

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 10:29

    If you have C# 4 you can make use of the new dynamics feature and the ExpandoObject. You can read a tutorial about it here.

提交回复
热议问题