C#-System.Dynamic.ExpandoObject

1             dynamic dynamicObject = new System.Dynamic.ExpandoObject();
2             dynamicObject.Id = Guid.NewGuid();
3             (dynamicObject as ICollection<KeyValuePair<string, object>>).Add(new KeyValuePair<string, object>("Name", "ChenFeng"));
4             Console.WriteLine(dynamicObject.Id);
5             Console.WriteLine(dynamicObject.Name);

 

posted @ 2019-10-08 20:10  自笑非  阅读(1164)  评论(0编辑  收藏  举报