JsonNumberHandling Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines how JsonSerializer handles numbers when serializing and deserializing.
This enumeration supports a bitwise combination of its member values.
public enum class JsonNumberHandling
[System.Flags]
public enum JsonNumberHandling
[<System.Flags>]
type JsonNumberHandling =
Public Enum JsonNumberHandling
- Inheritance
- Attributes
Fields
AllowNamedFloatingPointLiterals | 4 | The "NaN", "Infinity", and "-Infinity" String tokens can be read as floating-point constants, and the Single and Double values for these constants will be written as their corresponding JSON string representations. |
AllowReadingFromString | 1 | Numbers can be read from String tokens. Does not prevent numbers from being read from Number token. |
Strict | 0 | Numbers will only be read from Number tokens and will only be written as JSON numbers (without quotes). |
WriteAsString | 2 | Numbers will be written as JSON strings (with quotes), not as JSON numbers. |
Remarks
The behavior of WriteAsString and AllowNamedFloatingPointLiterals is not defined by the JSON specification. Altering the default number handling can potentially produce JSON that cannot be parsed by other JSON implementations.
Applies to
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για