Expando Objects

Since C# 4.0 .Net Framework permits creation of dynamic object from xml content. On MSDN is presented an article about this new type. 🙂

This type i’ve used in a big project in order to load an xml, and use the members from the tags.

I’ve created an static class who has only an public method who returns an ExpandoObject. Here is my implementation:

The usage of this class is presented next:

As you can see any type of xml content can be loaded, and then the “dynamic” object can be used like an object with members.

For this type of data i’ve found an object dumper so that i can see all the members from an expando object.

Both classes for the dumper and for the creator of expando object are located here – so you can download them.

Enjoy and modify them as you want 🙂

Posted in C#.