• CacheManager
  • Documentation
  • Api Docs
  • MichaCo.net
    Show / Hide Table of Contents

    Class JsonCacheSerializer

    Implements the ICacheSerializer contract using Newtonsoft.Json.

    Inheritance
    Object
    CacheSerializer
    JsonCacheSerializer
    GzJsonCacheSerializer
    Inherited Members
    CacheSerializer.SerializeCacheItem<T>(CacheItem<T>)
    CacheSerializer.DeserializeCacheItem<T>(Byte[], Type)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace:CacheManager.Serialization.Json
    Assembly:CacheManager.Serialization.Json.dll
    Syntax
    public class JsonCacheSerializer : CacheSerializer, ICacheSerializer

    Constructors

    | Improve this Doc View Source

    JsonCacheSerializer()

    Initializes a new instance of the JsonCacheSerializer class.

    Declaration
    public JsonCacheSerializer()
    | Improve this Doc View Source

    JsonCacheSerializer(JsonSerializerSettings, JsonSerializerSettings)

    Initializes a new instance of the JsonCacheSerializer class. With this overload the settings for de-/serialization can be set independently.

    Declaration
    public JsonCacheSerializer(JsonSerializerSettings serializationSettings, JsonSerializerSettings deserializationSettings)
    Parameters
    Type Name Description
    Newtonsoft.Json.JsonSerializerSettings serializationSettings

    The settings which should be used during serialization.

    Newtonsoft.Json.JsonSerializerSettings deserializationSettings

    The settings which should be used during deserialization.

    Properties

    | Improve this Doc View Source

    DeserializationSettings

    Gets the settings which should be used during deserialization. If nothing is specified the default Newtonsoft.Json.JsonSerializerSettings will be used.

    Declaration
    public JsonSerializerSettings DeserializationSettings { get; }
    Property Value
    Type Description
    Newtonsoft.Json.JsonSerializerSettings

    The deserialization settings.

    | Improve this Doc View Source

    SerializationSettings

    Gets the settings which should be used during serialization. If nothing is specified the default Newtonsoft.Json.JsonSerializerSettings will be used.

    Declaration
    public JsonSerializerSettings SerializationSettings { get; }
    Property Value
    Type Description
    Newtonsoft.Json.JsonSerializerSettings

    The serialization settings.

    Methods

    | Improve this Doc View Source

    CreateNewItem<TCacheValue>(ICacheItemProperties, Object)

    Declaration
    protected override object CreateNewItem<TCacheValue>(ICacheItemProperties properties, object value)
    Parameters
    Type Name Description
    ICacheItemProperties properties
    Object value
    Returns
    Type Description
    Object
    Type Parameters
    Name Description
    TCacheValue
    Overrides
    CacheSerializer.CreateNewItem<TCacheValue>(ICacheItemProperties, Object)
    | Improve this Doc View Source

    Deserialize(Byte[], Type)

    Declaration
    public override object Deserialize(byte[] data, Type target)
    Parameters
    Type Name Description
    System.Byte[] data
    Type target
    Returns
    Type Description
    Object
    Overrides
    CacheSerializer.Deserialize(Byte[], Type)
    | Improve this Doc View Source

    GetOpenGeneric()

    Declaration
    protected override Type GetOpenGeneric()
    Returns
    Type Description
    Type
    Overrides
    CacheSerializer.GetOpenGeneric()
    | Improve this Doc View Source

    Serialize<T>(T)

    Declaration
    public override byte[] Serialize<T>(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    System.Byte[]
    Type Parameters
    Name Description
    T
    Overrides
    CacheManager.Core.Internal.CacheSerializer.Serialize<T>(T)
    • Improve this Doc
    • View Source
    © 2025 by Michael Conrad. All rights reserved. - MichaCo.net