Open sandboxFocus

Class JsonCachingSerializer

An implementation of ISerializer that uses the JsonSerializer of System.Text.Json.

Inheritance
JsonCachingSerializer
Implements
Namespace: PostSharp.Patterns.Caching.Serializers
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public class JsonCachingSerializer : ISerializer
Remarks

The serialized value starts with the name of its type, as returned by GetTypeName(Type) (by default, the assembly-qualified name), followed by its JSON representation. Pass a JsonSerializerOptions to the constructor to customize the JSON serialization.

Constructors

Name Description
JsonCachingSerializer(JsonSerializerOptions)

Initializes a new instance of the JsonCachingSerializer class.

Methods

Name Description
Deserialize(byte[])

Deserializes a byte array into an object.

GetTypeName(Type)

Creates an assembly-qualified type name string from a Type.

ResolveTypeName(string)

Resolves an assembly-qualified type name to a Type.

Serialize(object)

Serializes an object into a byte array.