ExpandoObject Print
Dynamic Print method for ExpandoObject
Source
public static void Print(this ExpandoObject dynamicObject)
{
var dynamicDictionary = dynamicObject as IDictionary<string, object>;
foreach(KeyValuePair<string, object> property in dynamicDictionary)
{
Console.WriteLine("{0}: {1}", property.Key, property.Value.ToString());
}
Console.WriteLine();
}
Example
var dynamicObject = new ExpandoObject();
dynamicObject["Property"] = "Value";
dynamicObject.OtherProperty = 46;
dynamicObject.Print();