8,735
社区成员
发帖
与我相关
我的任务
分享
public class AttributesData
{
public string name { get; set; }
public string value{ get; set; }
public System.Collections.Generic.Dictionary<string, string> Attributes = new System.Collections.Generic.Dictionary<string, string>();
}
设置类属性:
AttributesData Mydata=new AttributesData ();
Mydata.Attributes.Add(变量名,变量值);
dynamic obj = new ExpandoObject();
//动态添加属性,随时加随时写
obj.name = "aaa";
obj.value = "bbb";
obj.date = "ccc";
obj.address = "ddd";