Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IJsonSerializer

    Provides functionality to serialize objects or value types to JSON and to deserialize JSON into objects or value types.

    Namespace: Umbraco.Cms.Core.Serialization
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IJsonSerializer

    Methods

    View Source

    Deserialize<T>(String)

    Parses the text representing a single JSON value into an instance of the type specified by a generic type parameter.

    Declaration
    T Deserialize<T>(string input)
    Parameters
    Type Name Description
    System.String input

    The JSON input to parse.

    Returns
    Type Description
    T

    A T representation of the JSON value.

    Type Parameters
    Name Description
    T

    The target type of the JSON value.

    View Source

    Serialize(Object)

    Converts the specified input into a JSON string.

    Declaration
    string Serialize(object input)
    Parameters
    Type Name Description
    System.Object input

    The input.

    Returns
    Type Description
    System.String

    A JSON string representation of the value.

    View Source

    TryDeserialize<T>(Object, out T)

    Attempts to parse an object that represents a JSON structure - i.e. a JSON object or a JSON array - to a strongly typed representation.

    Declaration
    bool TryDeserialize<T>(object input, out T value)
        where T : class
    Parameters
    Type Name Description
    System.Object input

    The object input to parse.

    T value

    The parsed result, or null if the parsing fails.

    Returns
    Type Description
    System.Boolean

    True if the parsing results in a non-null value, false otherwise.

    Type Parameters
    Name Description
    T

    The target type of the JSON value.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • Deserialize<T>(String)
      • Serialize(Object)
      • TryDeserialize<T>(Object, out T)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX