c# - adding new properties in expando object in foreach loop -
i have add new properties in expando object in foreach loop not able see way it. here example:
var allproperties = new list { "name", "email", "roles" }; allproperties.addrange(metadatamodel.getformattedfolders());
dynamic expando = new expandoobject(); foreach (var s in allproperties) { expando.s = string.empty; }
it consider 's' property instead of considering value of 's' property name.
thanks
var expando = new expandoobject() idictionary<string, object>; foreach (var s in allproperties) { expando.add(s, string.empty); }
Comments
Post a Comment