JsonConvert
Provides methods for converting between .NET types and JSON types.
Represents JavaScript's boolean value false as a string. This field is read-only.
Represents JavaScript's NaN as a string. This field is read-only.
Represents JavaScript's negative infinity as a string. This field is read-only.
Represents JavaScript's null as a string. This field is read-only.
Represents JavaScript's positive infinity as a string. This field is read-only.
Represents JavaScript's boolean value true as a string. This field is read-only.
Represents JavaScript's undefined as a string. This field is read-only.
Gets or sets a function that creates default JsonSerializerSettings.
Default settings are automatically used by serialization methods on JsonConvert,
and ToObject<T> and FromObject on JToken.
To serialize without using any default settings create a JsonSerializer with
Create.
Deserializes the JSON to the given anonymous type.
public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject, JsonSerializerSettings settings)
Deserializes the JSON to the given anonymous type using JsonSerializerSettings.
Deserializes the JSON to a .NET object.
Deserializes the JSON to a .NET object using JsonSerializerSettings.
Deserializes the JSON to the specified .NET type.
Deserializes the JSON to the specified .NET type.
Deserializes the JSON to the specified .NET type using a collection of JsonConverter.
Deserializes the JSON to the specified .NET type using JsonSerializerSettings.
Deserializes the JSON to the specified .NET type using a collection of JsonConverter.
Deserializes the JSON to the specified .NET type using JsonSerializerSettings.
Deserializes the XmlNode from a JSON string.
Deserializes the XmlNode from a JSON string nested in a root element specified by deserializeRootElementName.
public static XmlDocument DeserializeXmlNode(string value, string deserializeRootElementName, bool writeArrayAttribute)
Deserializes the XmlNode from a JSON string nested in a root element specified by deserializeRootElementName
and writes a Json.NET array attribute for collections.
Populates the object with values from the JSON string.
Populates the object with values from the JSON string using JsonSerializerSettings.
Serializes the specified object to a JSON string.
Serializes the specified object to a JSON string using formatting.
Serializes the specified object to a JSON string using a collection of JsonConverter.
public static string SerializeObject(object value, Formatting formatting, JsonConverter[] converters)
Serializes the specified object to a JSON string using formatting and a collection of JsonConverter.
Serializes the specified object to a JSON string using JsonSerializerSettings.
Serializes the specified object to a JSON string using a type, formatting and JsonSerializerSettings.
public static string SerializeObject(object value, Formatting formatting, JsonSerializerSettings settings)
Serializes the specified object to a JSON string using formatting and JsonSerializerSettings.
public static string SerializeObject(object value, Type type, Formatting formatting, JsonSerializerSettings settings)
Serializes the specified object to a JSON string using a type, formatting and JsonSerializerSettings.
Serializes the XmlNode to a JSON string.
Serializes the XmlNode to a JSON string using formatting.
Serializes the XmlNode to a JSON string using formatting and omits the root object if omitRootObject is true.
Converts the DateTime to its JSON string representation.
public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling)
Converts the DateTime to its JSON string representation using the DateFormatHandling specified.
Converts the Boolean to its JSON string representation.
Converts the Char to its JSON string representation.
Converts the Enum to its JSON string representation.
Converts the Int32 to its JSON string representation.
Converts the Int16 to its JSON string representation.
Converts the UInt16 to its JSON string representation.
Converts the UInt32 to its JSON string representation.
Converts the Int64 to its JSON string representation.
Converts the UInt64 to its JSON string representation.
Converts the Single to its JSON string representation.
Converts the Double to its JSON string representation.
Converts the Byte to its JSON string representation.
Converts the SByte to its JSON string representation.
Converts the Decimal to its JSON string representation.
Converts the Guid to its JSON string representation.
Converts the TimeSpan to its JSON string representation.
Converts the Uri to its JSON string representation.
Converts the String to its JSON string representation.
Converts the String to its JSON string representation.
public static string ToString(string value, char delimiter, StringEscapeHandling stringEscapeHandling)
Converts the String to its JSON string representation.
Converts the Object to its JSON string representation.