Serializing and Deserializing .net 4.0 ExpandoObject

I get an error message:

System.InvalidCastException: it is not possible to cast an object of type "System.Dynamic.ExpandoObject" to enter "System.Collections.IDictionary".

I usually get ExpandoObjectand then add an attribute of the derived class to indicate the custom TypeConverter that I am writing. I don't know how else to register a TypeConverter for a type. ExpandoObject is sealed.

In one thread of the codeplex project, there was a patch for distribution. I would probably rather get a JsonConverter, though, I haven't done it yet.

So, before I go aside, is there a suggested approach here?

+3
source share
1

ExpandoObjectConverter Json.NET( Newtonsoft) 2011 .

0

Source: https://habr.com/ru/post/1774866/


All Articles