Skip to content

Commit 6f40084

Browse files
authored
JsonElement and Utf8JsonReader consistency for TryParse... methods (dotnet#7427)
1 parent ecbcfd4 commit 6f40084

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

xml/System.Text.Json/JsonElement.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ For other types, the value of <xref:System.Text.Json.JsonElement.GetRawText> is
10691069
<Parameter Name="value" Type="System.Byte" RefType="out" />
10701070
</Parameters>
10711071
<Docs>
1072-
<param name="value">When the method returns, contains the byte equivalent of the current JSON number if the conversion succeeded.</param>
1072+
<param name="value">When this method returns, contains the byte equivalent of the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
10731073
<summary>Attempts to represent the current JSON number as a <see cref="T:System.Byte" />.</summary>
10741074
<returns>
10751075
<see langword="true" /> if the number can be represented as a <see cref="T:System.Byte" />; otherwise, <see langword="false" />.</returns>
@@ -1155,7 +1155,7 @@ This method does not create a byte array representation of values other than Bas
11551155
<Parameter Name="value" Type="System.DateTime" RefType="out" />
11561156
</Parameters>
11571157
<Docs>
1158-
<param name="value">When this method returns, contains the date and time value equivalent to the current JSON string.</param>
1158+
<param name="value">When this method returns, contains the date and time value equivalent to the current JSON string if the conversion succeeded, or <see cref="P:System.DateTime.MinValue" /> if the conversion failed.</param>
11591159
<summary>Attempts to represent the current JSON string as a <see cref="T:System.DateTime" />.</summary>
11601160
<returns>
11611161
<see langword="true" /> if the string can be represented as a <see cref="T:System.DateTime" />; otherwise, <see langword="false" />.</returns>
@@ -1194,7 +1194,7 @@ This method only creates a DateTime representation of JSON strings that conform
11941194
<Parameter Name="value" Type="System.DateTimeOffset" RefType="out" />
11951195
</Parameters>
11961196
<Docs>
1197-
<param name="value">When this method returns, contains the date and time equivalent to the current JSON string.</param>
1197+
<param name="value">When this method returns, contains the date and time value equivalent to the current JSON string if the conversion succeeded, or <see cref="P:System.DateTimeOffset.MinValue" /> if the conversion failed.</param>
11981198
<summary>Attempts to represent the current JSON string as a <see cref="T:System.DateTimeOffset" />.</summary>
11991199
<returns>
12001200
<see langword="true" /> if the string can be represented as a <see cref="T:System.DateTimeOffset" />; otherwise, <see langword="false" />.</returns>
@@ -1233,7 +1233,7 @@ This method only creates a DateTimeOffset representation of JSON strings that co
12331233
<Parameter Name="value" Type="System.Decimal" RefType="out" />
12341234
</Parameters>
12351235
<Docs>
1236-
<param name="value">When this method returns, contains the decimal equivalent of the current JSON number.</param>
1236+
<param name="value">When this method returns, contains the decimal equivalent of the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
12371237
<summary>Attempts to represent the current JSON number as a <see cref="T:System.Decimal" />.</summary>
12381238
<returns>
12391239
<see langword="true" /> if the number can be represented as a <see cref="T:System.Decimal" />; otherwise, <see langword="false" />.</returns>
@@ -1272,7 +1272,7 @@ This method does not parse the contents of a JSON string value.
12721272
<Parameter Name="value" Type="System.Double" RefType="out" />
12731273
</Parameters>
12741274
<Docs>
1275-
<param name="value">When this method returns, contains a double-precision floating point value equivalent to the current JSON number.</param>
1275+
<param name="value">When this method returns, contains a double-precision floating point value equivalent to the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
12761276
<summary>Attempts to represent the current JSON number as a <see cref="T:System.Double" />.</summary>
12771277
<returns>
12781278
<see langword="true" /> if the number can be represented as a <see cref="T:System.Double" />; otherwise, <see langword="false" />.</returns>
@@ -1313,7 +1313,7 @@ On .NET Core, this method does not return `false` for values larger than <xref:S
13131313
<Parameter Name="value" Type="System.Guid" RefType="out" />
13141314
</Parameters>
13151315
<Docs>
1316-
<param name="value">When this method returns, contains the GUID equivalent to the current JSON string.</param>
1316+
<param name="value">When this method returns, contains the GUID equivalent to the current JSON string if the conversion succeeded, or <see cref="P:System.Guid.Empty" /> if the conversion failed.</param>
13171317
<summary>Attempts to represent the current JSON string as a <see cref="T:System.Guid" />.</summary>
13181318
<returns>
13191319
<see langword="true" /> if the string can be represented as a <see cref="T:System.Guid" />; otherwise, <see langword="false" />.</returns>
@@ -1352,7 +1352,7 @@ This method does not create a Guid representation of values other than JSON stri
13521352
<Parameter Name="value" Type="System.Int16" RefType="out" />
13531353
</Parameters>
13541354
<Docs>
1355-
<param name="value">When the method returns, contains the 16-bit integer equivalent of the current JSON number if the conversion succeeded.</param>
1355+
<param name="value">When this method returns, contains the 16-bit integer value equivalent of the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
13561356
<summary>Attempts to represent the current JSON number as an <see cref="T:System.Int16" />.</summary>
13571357
<returns>
13581358
<see langword="true" /> if the number can be represented as an <see cref="T:System.Int16" />; otherwise, <see langword="false" />.</returns>
@@ -1391,7 +1391,7 @@ This method does not parse the contents of a JSON string value.
13911391
<Parameter Name="value" Type="System.Int32" RefType="out" />
13921392
</Parameters>
13931393
<Docs>
1394-
<param name="value">When this method returns, contains the 32-bit integer value equivalent to the current JSON number.</param>
1394+
<param name="value">When this method returns, contains the 32-bit integer value equivalent to the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
13951395
<summary>Attempts to represent the current JSON number as an <see cref="T:System.Int32" />.</summary>
13961396
<returns>
13971397
<see langword="true" /> if the number can be represented as an <see cref="T:System.Int32" />; otherwise, <see langword="false" />.</returns>
@@ -1430,7 +1430,7 @@ This method does not parse the contents of a JSON string value.
14301430
<Parameter Name="value" Type="System.Int64" RefType="out" />
14311431
</Parameters>
14321432
<Docs>
1433-
<param name="value">When this method returns, contains the 64-bit integer value equivalent to the current JSON number.</param>
1433+
<param name="value">When this method returns, contains the 64-bit integer value equivalent to the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
14341434
<summary>Attempts to represent the current JSON number as a <see cref="T:System.Int64" />.</summary>
14351435
<returns>
14361436
<see langword="true" /> if the number can be represented as a <see cref="T:System.Int64" />; otherwise, <see langword="false" />.</returns>
@@ -1608,7 +1608,7 @@ If a property is defined multiple times for the same object, the method matches
16081608
<Parameter Name="value" Type="System.SByte" RefType="out" />
16091609
</Parameters>
16101610
<Docs>
1611-
<param name="value">When the method returns, contains the signed byte equivalent of the current JSON number if the conversion succeeded.</param>
1611+
<param name="value">When this method returns, contains the signed byte equivalent of the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
16121612
<summary>Attempts to represent the current JSON number as an <see cref="T:System.SByte" />.</summary>
16131613
<returns>
16141614
<see langword="true" /> if the number can be represented as an <see cref="T:System.SByte" />; otherwise, <see langword="false" />.</returns>
@@ -1647,7 +1647,7 @@ This method does not parse the contents of a JSON string value.
16471647
<Parameter Name="value" Type="System.Single" RefType="out" />
16481648
</Parameters>
16491649
<Docs>
1650-
<param name="value">When this method returns, contains the single-precision floating point value equivalent to the current JSON number.</param>
1650+
<param name="value">When this method returns, contains the single-precision floating point value equivalent to the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
16511651
<summary>Attempts to represent the current JSON number as a <see cref="T:System.Single" />.</summary>
16521652
<returns>
16531653
<see langword="true" /> if the number can be represented as a <see cref="T:System.Single" />; otherwise, <see langword="false" />.</returns>
@@ -1694,7 +1694,7 @@ On .NET Core, this method does not return `false` for values larger than <xref:S
16941694
<Parameter Name="value" Type="System.UInt16" RefType="out" />
16951695
</Parameters>
16961696
<Docs>
1697-
<param name="value">When the method returns, contains the unsigned 16-bit integer equivalent of the current JSON number if the conversion succeeded.</param>
1697+
<param name="value">When this method returns, contains the unsigned 16-bit integer value equivalent of the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
16981698
<summary>Attempts to represent the current JSON number as a <see cref="T:System.UInt16" />.</summary>
16991699
<returns>
17001700
<see langword="true" /> if the number can be represented as a <see cref="T:System.UInt16" />; otherwise, <see langword="false" />.</returns>
@@ -1739,7 +1739,7 @@ This method does not parse the contents of a JSON string value.
17391739
<Parameter Name="value" Type="System.UInt32" RefType="out" />
17401740
</Parameters>
17411741
<Docs>
1742-
<param name="value">When this method returns, contains unsigned 32-bit integer value equivalent to the current JSON number.</param>
1742+
<param name="value">When this method returns, contains unsigned 32-bit integer value equivalent to the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
17431743
<summary>Attempts to represent the current JSON number as a <see cref="T:System.UInt32" />.</summary>
17441744
<returns>
17451745
<see langword="true" /> if the number can be represented as a <see cref="T:System.UInt32" />; otherwise, <see langword="false" />.</returns>
@@ -1784,7 +1784,7 @@ This method does not parse the contents of a JSON string value.
17841784
<Parameter Name="value" Type="System.UInt64" RefType="out" />
17851785
</Parameters>
17861786
<Docs>
1787-
<param name="value">When this method returns, contains unsigned 64-bit integer value equivalent to the current JSON number.</param>
1787+
<param name="value">When this method returns, contains unsigned 64-bit integer value equivalent to the current JSON number if the conversion succeeded, or 0 if the conversion failed.</param>
17881788
<summary>Attempts to represent the current JSON number as a <see cref="T:System.UInt64" />.</summary>
17891789
<returns>
17901790
<see langword="true" /> if the number can be represented as a <see cref="T:System.UInt64" />; otherwise, <see langword="false" />.</returns>

0 commit comments

Comments
 (0)