How do I convert a dynamic object to a Dictionary in C# What can I do?
Dictionary
public static void MyMethod(object obj) { if (typ
You can use this:
Dictionary mydic = ((IEnumerable)obj).Cast().ToList().ToDictionary(px => px.GetType().GetProperty("Key").GetValue(px), pv => pv.GetType().GetProperty("Value").GetValue(pv));