Add property to POCO class at runtime

后端 未结 4 1817
感情败类
感情败类 2020-12-19 03:55

I selected ServiceStack OrmLite for my project which is a pure Data-Oriented application. I am willing to allow the end user to create his own Object Types defined in an XML

4条回答
  •  悲哀的现实
    2020-12-19 04:22

    Why not use a key value pair for all its properties, or at least the dynamic ones?

    http://msdn.microsoft.com/en-us/library/system.collections.hashtable.aspx

    You can do it the way you're describing with Reflection but it will take a performance hit, this way will allow removal of properties also.

提交回复
热议问题