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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -