(in the 2.0-.Net.Core branch)
Example:
- You download a
Post
- You want to persist that
Post in disk (because for example you are testing something and you don't want to retrieve it from the internet at every time)
- You serialize it via Newtonsoft.Json, and you persist it in disk
When you try to deserialize this json you find several issues:
- In the props that include
UnixTimestampConverter, the converter expects an Int64 as an input. The serialized json contains a DateTime.
- You cannot bypass
WebAgent, you should inject it via dependency injection instead.
The simplest solution that I have found is: making the RawJson (the JToken) public in Thing (link to the line of code). I can then access Post.RawJson (or on any other Thing) and serialize it, and then deserialize it via new Post(webAgent, rawJson).
Would you consider making this property public? It would be really helpful.
Looking forward to your feedback.
(in the
2.0-.Net.Corebranch)Example:
PostPostin disk (because for example you are testing something and you don't want to retrieve it from the internet at every time)When you try to deserialize this json you find several issues:
UnixTimestampConverter, the converter expects an Int64 as an input. The serialized json contains a DateTime.WebAgent, you should inject it via dependency injection instead.The simplest solution that I have found is: making the
RawJson(theJToken) public inThing(link to the line of code). I can then accessPost.RawJson(or on any otherThing) and serialize it, and then deserialize it vianew Post(webAgent, rawJson).Would you consider making this property public? It would be really helpful.
Looking forward to your feedback.