Search Results for

    Show / Hide Table of Contents
    View Source

    Class SystemTextJsonSerializerBase

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Infrastructure.Serialization
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class SystemTextJsonSerializerBase : IJsonSerializer

    Properties

    View Source

    JsonSerializerOptions

    Declaration
    protected abstract JsonSerializerOptions JsonSerializerOptions { get; }
    Property Value
    Type Description
    System.Text.Json.JsonSerializerOptions

    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
    public 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
    public 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
    public 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
    • Properties
      • JsonSerializerOptions
    • Methods
      • Deserialize<T>(String)
      • Serialize(Object)
      • TryDeserialize<T>(Object, out T)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX