/// <summary>
        /// Configures the cache manager to use the <code>Microsoft.Bond</code> based cache serializer.
        /// This version uses <see cref="Bond.Protocols.FastBinaryWriter{O}"/> and <see cref="Bond.Protocols.FastBinaryReader{I}"/>.
        /// </summary>
        /// <param name="part">The configuration part.</param>
        /// <param name="defaultWriteBufferSize">The buffer size used to serialize objects. Can be used to tune Bond performance.</param>
        /// <returns>The builder instance.</returns>
        public static ConfigurationBuilderCachePart WithBondFastBinarySerializer(this ConfigurationBuilderCachePart part, int defaultWriteBufferSize = 1024)
        {
            NotNull(part, nameof(part));

            return(part.WithSerializer(typeof(BondFastBinaryCacheSerializer), defaultWriteBufferSize));
        }
        /// <summary>
        /// Configures the cache manager to use the <code>Microsoft.Bond</code> based cache serializer.
        /// This version uses <see cref="Bond.Protocols.FastBinaryWriter{O}"/> and <see cref="Bond.Protocols.FastBinaryReader{I}"/>.
        /// </summary>
        /// <param name="part">The configuration part.</param>
        /// <returns>The builder instance.</returns>
        public static ConfigurationBuilderCachePart WithBondSimpleJsonSerializer(this ConfigurationBuilderCachePart part)
        {
            NotNull(part, nameof(part));

            return(part.WithSerializer(typeof(BondSimpleJsonCacheSerializer)));
        }
Пример #3
0
        /// <summary>
        /// Configures the cache manager to use the <code>Newtonsoft.Json</code> based cache serializer.
        /// </summary>
        /// <param name="part">The configuration part.</param>
        /// <param name="serializationSettings">The settings to be used during serialization.</param>
        /// <param name="deserializationSettings">The settings to be used during deserialization.</param>
        /// <returns>The builder instance.</returns>
        public static ConfigurationBuilderCachePart WithJsonSerializer(this ConfigurationBuilderCachePart part, JsonSerializerSettings serializationSettings, JsonSerializerSettings deserializationSettings)
        {
            NotNull(part, nameof(part));

            return(part.WithSerializer(typeof(JsonCacheSerializer), serializationSettings, deserializationSettings));
        }