JsonConvert.Deserializer indexing issues

后端 未结 4 612
情话喂你
情话喂你 2020-11-29 14:07

While playing around Stack collection in C# I encountered the following issue. Exactly I am not sure why it is happening. Please put some light on the reason and alternative

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 14:14

    If you try to debug it then you will notice that items order is broken after Stack deserialization.

    The same question has been asked on JSON.NET GitHub issue tracker a month ago.

    The answer from JamesNK:

    I'm afraid this is a limition of a Stack. The results returned when it is serialized and the opposite order for when it is deserialized.

提交回复
热议问题