-Documentation
-Fixed potential casting error when writing JSON using a JsonReader
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
<h3>Conversion Rules</h3>
|
<h3>Conversion Rules</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Elements remain unchanged. </li>
|
<li>Elements remain unchanged. </li>
|
||||||
<li>Attributes are prefixed with an @. </li>
|
<li>Attributes are prefixed with an @ and should be at the start of the object. </li>
|
||||||
<li>Single child text nodes are a value directly against an element, otherwise they
|
<li>Single child text nodes are a value directly against an element, otherwise they
|
||||||
are accessed via #text. </li>
|
are accessed via #text. </li>
|
||||||
<li>The XML declaration and processing instructions are prefixed with ?. </li>
|
<li>The XML declaration and processing instructions are prefixed with ?. </li>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -353,16 +353,16 @@ namespace Newtonsoft.Json
|
|||||||
WriteComment(reader.Value.ToString());
|
WriteComment(reader.Value.ToString());
|
||||||
break;
|
break;
|
||||||
case JsonToken.Integer:
|
case JsonToken.Integer:
|
||||||
WriteValue((long)reader.Value);
|
WriteValue(Convert.ToInt64(reader.Value));
|
||||||
break;
|
break;
|
||||||
case JsonToken.Float:
|
case JsonToken.Float:
|
||||||
WriteValue((double)reader.Value);
|
WriteValue(Convert.ToDouble(reader.Value));
|
||||||
break;
|
break;
|
||||||
case JsonToken.String:
|
case JsonToken.String:
|
||||||
WriteValue(reader.Value.ToString());
|
WriteValue(reader.Value.ToString());
|
||||||
break;
|
break;
|
||||||
case JsonToken.Boolean:
|
case JsonToken.Boolean:
|
||||||
WriteValue((bool)reader.Value);
|
WriteValue(Convert.ToBoolean(reader.Value));
|
||||||
break;
|
break;
|
||||||
case JsonToken.Null:
|
case JsonToken.Null:
|
||||||
WriteNull();
|
WriteNull();
|
||||||
|
|||||||
Reference in New Issue
Block a user