Class Serializer
Provides methods for serializing and deserializing objects to and from JSON. This serializer is configured to be case-insensitive.
public static class Serializer
- Inheritance
-
Serializer
- Inherited Members
Methods
Deserialize<T>(string, JsonSerializerOptions?)
Deserializes the JSON string to the specified type.
public static T Deserialize<T>(string json, JsonSerializerOptions? options = null)
Parameters
json
stringThe JSON string to deserialize.
options
JsonSerializerOptionsOptional custom serialization options
Returns
- T
The deserialized object of type T.
Type Parameters
T
The type to deserialize the JSON string to.
Serialize(object, JsonSerializerOptions?)
Serializes the specified object to a JSON string.
public static string Serialize(object any, JsonSerializerOptions? options = null)
Parameters
any
objectThe object to serialize.
options
JsonSerializerOptionsOptional custom serialization options
Returns
- string
The JSON string representation of the object.