csharp convert dictionary to anonymous object

Code Example - csharp convert dictionary to anonymous object

                
                        var dict = new Dictionary<string, object> { { "Property", "foo" } };
dynamic eo = dict.Aggregate(new ExpandoObject() as IDictionary<string, Object>,
                            (a, p) => { a.Add(p.Key, p.Value); return a; });
string value = eo.Property;