Exemple #1
0
        public static byte[] Serialize(T message)
        {
            var key = HashBuilder.GenerateHash <T>(message);

            byte[] value;

            if (Cache.TryGetValue(key, out value))
            {
                return(value);
            }

            value = SerializerFunc(message);
            Cache.Add(key, value);

            return(value);
        }
Exemple #2
0
        public static byte[] Serialize(T message)
        {
            var key = HashBuilder.GenerateHash(message);

            if (Cache.TryGetValue(key, out byte[] value))