i have this
dynamic d = new ExpandoObject();
d.Name = attribute.QualifiedName.Name;
so , i know that d will have a property Name. Now if i
You can also do like this:-
Dictionary coll = new Dictionary();
coll.Add("Prop1","hello");
coll.Add("Prop2",1);
System.Dynamic.ExpandoObject obj = dic.Expando();
//You can have this ext method to better help
public static ExpandoObject Expando(this IEnumerable>
dictionary)
{
var expando = new ExpandoObject();
var expandoDic = (IDictionary)expando;
foreach (var item in dictionary)
{
expandoDic.Add(item);
}
return expando;
}