Class JsonConfigurationBuilderExtensions
Extensions for the configuration builder for the Newtonsoft.Json
based ICacheSerializer
.
Configuring CacheManager to use the JSON serializer will replace the default Binary serializer.
Usage
Basic usage example:
var builder = new Core.ConfigurationBuilder();
builder.WithJsonSerializer();
optionally, Newtonsoft.Json.JsonSerializerSettings
can be specified for (de)serialization.
See the official documentation for more details.
builder.WithJsonSerializer(new JsonSerializerSettings(), new JsonSerializerSettings());
Inherited Members
Namespace:CacheManager.Core
Assembly:CacheManager.Serialization.Json.dll
Syntax
public static class JsonConfigurationBuilderExtensions
Methods
| Improve this Doc View SourceWithGzJsonSerializer(ConfigurationBuilderCachePart)
Configures the cache manager to use the
Newtonsoft.Json
based cache serializer with compression.
Declaration
public static ConfigurationBuilderCachePart WithGzJsonSerializer(this ConfigurationBuilderCachePart part)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationBuilderCachePart | part | The configuration part. |
Returns
Type | Description |
---|---|
ConfigurationBuilderCachePart | The builder instance. |
WithGzJsonSerializer(ConfigurationBuilderCachePart, JsonSerializerSettings, JsonSerializerSettings)
Configures the cache manager to use the
Newtonsoft.Json
based cache serializer with compression.
Declaration
public static ConfigurationBuilderCachePart WithGzJsonSerializer(this ConfigurationBuilderCachePart part, JsonSerializerSettings serializationSettings, JsonSerializerSettings deserializationSettings)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationBuilderCachePart | part | The configuration part. |
Newtonsoft.Json.JsonSerializerSettings | serializationSettings | The settings to be used during serialization. |
Newtonsoft.Json.JsonSerializerSettings | deserializationSettings | The settings to be used during deserialization. |
Returns
Type | Description |
---|---|
ConfigurationBuilderCachePart | The builder instance. |
WithJsonSerializer(ConfigurationBuilderCachePart)
Configures the cache manager to use the
Newtonsoft.Json
based cache serializer.
Declaration
public static ConfigurationBuilderCachePart WithJsonSerializer(this ConfigurationBuilderCachePart part)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationBuilderCachePart | part | The configuration part. |
Returns
Type | Description |
---|---|
ConfigurationBuilderCachePart | The builder instance. |
WithJsonSerializer(ConfigurationBuilderCachePart, JsonSerializerSettings, JsonSerializerSettings)
Configures the cache manager to use the
Newtonsoft.Json
based cache serializer.
Declaration
public static ConfigurationBuilderCachePart WithJsonSerializer(this ConfigurationBuilderCachePart part, JsonSerializerSettings serializationSettings, JsonSerializerSettings deserializationSettings)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationBuilderCachePart | part | The configuration part. |
Newtonsoft.Json.JsonSerializerSettings | serializationSettings | The settings to be used during serialization. |
Newtonsoft.Json.JsonSerializerSettings | deserializationSettings | The settings to be used during deserialization. |
Returns
Type | Description |
---|---|
ConfigurationBuilderCachePart | The builder instance. |