Add Dump to ExpandoObject
'System.Dynamic.ExpandoObject' does not contain a definition for 'Dump'
Can this be added? (Is it possible?)
12
votes
anonymous
shared this idea
-
Yes - or you can cast it to object - or use Console.WriteLine instead and get the same result:
dynamic x = new ExpandoObject();
x.Name = "Mario";
x.Age = 23;
((object)x).Dump();
Console.WriteLine (x); // same result -
Hemme commented
You can cast it to IDictionary<string,object> before dumping it.
For instance:dynamic x = new ExpandoObject();
x.Name = "Mario";
x.Age = 23;
((IDictionary<string,object>)x).Dump();