JToken: Get raw/original JSON value

前端 未结 3 626
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 07:28

Is there a way to get the raw/original JSON value from a JToken?

The problem:

var data = JObject.Parse(@\"{
    \"\"SimpleDate\"\":\"\"         


        
3条回答
  •  爱一瞬间的悲伤
    2020-11-27 08:07

    There's a solution I found in Json.NET Disable the deserialization on DateTime:

    JsonReader reader = new JsonTextReader(new StringReader(j1.ToString()));
    reader.DateParseHandling = DateParseHandling.None;
    JObject o = JObject.Load(reader);
    

提交回复
热议问题