File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
fundamentals/serialization Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ attributes change the way that the driver serializes each property of
87
87
your POCO. This section describes some of the common
88
88
serialization-related attributes.
89
89
90
-
91
90
Serialize Read-Only Properties
92
91
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93
92
@@ -195,6 +194,12 @@ For more information on valid type conversions, see the `{+language+}
195
194
Conversions Specification
196
195
<https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions>`__.
197
196
197
+ .. important:: Serializing NaN and Infinity
198
+
199
+ If you try to serialize or deserialize a floating-point
200
+ ``Infinity`` or ``NaN`` value to an integral representation, the driver throws an
201
+ ``OverflowException``.
202
+
198
203
Set Field Order
199
204
~~~~~~~~~~~~~~~
200
205
Original file line number Diff line number Diff line change @@ -144,3 +144,12 @@ Version 3.0 Breaking Changes
144
144
145
145
- The ``MongoClient`` constructor accepts only one ``Credential`` object instead of an
146
146
array.
147
+
148
+ - If you try to serialize or deserialize a floating-point
149
+ ``Infinity`` or ``NaN`` value to an integral representation, the driver throws an
150
+ ``OverflowException``. To learn more about floating-point ``Infinity`` and ``NaN``
151
+ values, see
152
+ `Double.NaN, <https://learn.microsoft.com/en-us/dotnet/api/system.double.nan?view=net-8.0#system-double-nan>`__
153
+ `Double.PositiveInfinity, <https://learn.microsoft.com/en-us/dotnet/api/system.double.positiveinfinity?view=net-8.0#system-double-positiveinfinity>`__
154
+ and `Double.NegativeInfinity. <https://learn.microsoft.com/en-us/dotnet/api/system.double.negativeinfinity?view=net-8.0#system-double-negativeinfinity>`__
155
+ on MSDN.
You can’t perform that action at this time.
0 commit comments