Base solution for your next web application
Open Closed

Dictionary serialization change from version 0.9.7 to 1.0 #1971


User avatar
0
marcosb created

I was using version 0.9.7 and .Net dictionaries were serialized as follows in json {"key1":"value1","key2":"value2"}

Now dictionaries are serialized as: {"Comparer":{},"Count":2,"Keys":["key1","key2"],"Values":["value1","value2"]}

Any idea how can I change serialization settings to get the 0.9.7 behavior? I have a lot of javascript code that relies on the previous structure.


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    As you know, ABP uses Newtonsoft's Json.Net for serialization. Did you search web for it or did you try to directly use json.net to serialize it for a comparison. If you think it's related to ABP, please share your code part so we can test it. But, we didn't have the same issue before and we are using dictionaries too.

  • User Avatar
    0
    marcosb created

    Thanks for the reply.

    Previous to the post I searched for json.net but found nothing. After you replied and told me that you were using dictionaries without problems I continued investigating and finally found that the issue was related to the new version of automapper, and how it mapped dictionaries.

    Problem solved. It was not related to ABP. You can close this post or remove it if you want to avoid confussion. Thanks.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thank you for sharing your solution :). I'm sure it will help others.