✅ Newtonsoft.JSON correctly serializes data but erroneously leaves out arrays during deserialization
My simplified code is as follows:
After serializing the
Game
class, I end up with:
This is correct, but deserializing the Game
class from this json results in this data:
The buildings array has been lost during deserialization. This same behaviour happens with the built-in JsonSerializer
.17 Replies
after changing
to
it works
.. i think
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yeah i cant do that
i need to fire events when my properties change
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
so the backing field is required
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yeah im doing mvvm
and i am using mvvm toolkit, but im in model layer
so no real use for it there
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
no i dont want inpc
inpc is for viewmodel layer
i just want to send events
you aren't supposed to use mvvmtoolkit in the model layer
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
what would be the proper usage of full props? this?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
because i opt out of implicit serialisation
so i need to manually specify what to serialize
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity./close
Closed!