C# .net add property to expando object dynamically Edit
sample code to add property to a C# expando object dynamically
Sample Code
public void AddProperty(ExpandoObject expando, string propertyName, object propertyValue) { // ExpandoObject supports IDictionary so we can extend it like this var expandoDict = expando as IDictionary<string, object>; if (expandoDict.ContainsKey(propertyName)) expandoDict[propertyName] = propertyValue; else expandoDict.Add(propertyName, propertyValue); }