我的数据集如下。
Name | Type | OptionType | Value -------------------------------------------- Count | int | null | 20 volume | double | null | 10.2 customer | string | null | tim direction| option | Left, Right | Left shape | option | rect, circle | rect … | … | … | …
(不仅仅是5.这么多数据集)
处理数据集的最佳设计模式或数据结构是什么?
我试着想下面......
Dictionary <name, object> dataDictionary;
// add
dataDictionary.Add("count", (int)20);
dataDictionary.Add("volume", (double)10.2);
dataDictionary.Add("customer", "tim");
dataDictionary.Add("direction", enumDirection.Left);
dataDictionary.Add("shape", enumShape.Rect);
// get - **I have to know data type….**
int count = (int)dataDictionary["count"];
double volume = (double)dataDictionary["volume"] ;
string customer = (string)dataDictionary["customer"];
enumDirection eDirection = (enumDirection)dataDictionary["direction"];
有什么更好的吗?