开发者

C# dynamic class properties question

开发者 https://www.devze.com 2023-01-23 14:14 出处:网络
I have a question regarding the most efficient way to design a class that handles a large number (10K+) of dynamic properti开发者_开发知识库es.Properties only hold boolean or double value types.

I have a question regarding the most efficient way to design a class that handles a large number (10K+) of dynamic properti开发者_开发知识库es. Properties only hold boolean or double value types.

I've thought of a couples of answers but not sure if I am on track.

  1. Class has one property that passes a hashtable
  2. Create class at runtime with properties that represent parent nodes, that can be used to retrieve child classes with child node properties.


I trust that you're not actually talking about properties but a collection of name-value pairs. That's covered by the Dictionary<> class. The ExpandoObject class, available in .NET 4.0 is perhaps worth mentioning.

0

精彩评论

暂无评论...
验证码 换一张
取 消