[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IJsonSerializer.Deserialize

Deserialize Method

Deserialize(string)

Deserializes a JSON string to an object.

Implement this method to reconstruct an application-specific object from its JSON representation. The concrete return type depends on the serializer implementation and how the JSON content is interpreted.

Declaration
object Deserialize(string json)
Function Deserialize(json As String) As Object
Parameters
Type Name Description
string json

The JSON string to deserialize.

Returns
Type Description
object

The object created from the specified JSON string.

Examples
public class SimpleJsonSerializer : IJsonSerializer
{
    public string Serialize(object value)
    {
        return System.Text.Json.JsonSerializer.Serialize(new { value });
    }

    public object Deserialize(string json)
    {
        return System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, object>>(json);
    }
}

IJsonSerializer serializer = new SimpleJsonSerializer();
object value = serializer.Deserialize("{\"value\":\"A\"}");