Answers for "c# convert dictionary to anonymous object"

C#
2

c# 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;
Posted by: Guest on May-21-2020

Code answers related to "c# convert dictionary to anonymous object"

C# Answers by Framework

Browse Popular Code Answers by Language