发布于 4年前

C#给ExpandoObject动态添加属性

C#给ExpandoObject动态添加对象:

方法一:

dynamic x = new ExpandoObject();
x.NewProp = string.Empty;

方法二:

var x = new ExpandoObject() as IDictionary<string, Object>;
x.Add("NewProp", string.Empty);
C#
©2020 edoou.com   京ICP备16001874号-3