Add property to POCO class at runtime

后端 未结 4 1812
感情败类
感情败类 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:30

    Check out the ExpandoObject, which provides dynamic language support for doing something like this. You can use it to add additional properties to your POCO's at runtime. Here's a link on using .NET's DLR features: http://msdn.microsoft.com/en-us/library/system.dynamic.expandoobject%28v=vs.100%29.aspx

提交回复
热议问题