Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Class JsonSerializer

    Provides JSON serialization and deserialization using System.Text.Json.

    Inheritance
    object
    JsonSerializer
    Implements
    ISerializer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Innovt.Core.Serialization
    Assembly: Innovt.Core.dll
    Syntax
    public class JsonSerializer : ISerializer

    Constructors

    | Edit this page View Source

    JsonSerializer(bool, bool, bool, IList<JsonConverter>)

    Initializes a new instance of the JsonSerializer class with specified options.

    Declaration
    public JsonSerializer(bool ignoreNullValues = true, bool ignoreReadOnlyProperties = true, bool propertyNameCaseInsensitive = true, IList<JsonConverter> converters = null)
    Parameters
    Type Name Description
    bool ignoreNullValues

    Indicates whether null values should be ignored during serialization.

    bool ignoreReadOnlyProperties

    Indicates whether read-only properties should be ignored during serialization.

    bool propertyNameCaseInsensitive

    Indicates whether property name casing should be treated as case-insensitive.

    IList<JsonConverter> converters

    A list of custom JSON converters to be used during serialization and deserialization.

    Methods

    | Edit this page View Source

    DeserializeObject<T>(string)

    Deserializes a JSON string into an object of type T.

    Declaration
    public T DeserializeObject<T>(string serializedObject)
    Parameters
    Type Name Description
    string serializedObject

    The JSON string to deserialize.

    Returns
    Type Description
    T

    The deserialized object of type T.

    Type Parameters
    Name Description
    T

    The type of object to deserialize.

    | Edit this page View Source

    SerializeObject<T>(T)

    Serializes an object of type T into a JSON string.

    Declaration
    public string SerializeObject<T>(T obj)
    Parameters
    Type Name Description
    T obj

    The object to serialize.

    Returns
    Type Description
    string

    The serialized object as a JSON string.

    Type Parameters
    Name Description
    T

    The type of object to serialize.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the obj parameter is null.

    Implements

    ISerializer

    Extension Methods

    Extensions.IsNull(object)
    Extensions.ToStringOrDefault(object)
    SimpleMapper.MapTo<T1>(object)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX