ExpandoObject Print

        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();

Description

Dynamic Print method for ExpandoObject

Details

Double click on the code to select all.

 

;