Example #1
0
        /// <summary>
        /// Builds a full cache key in the format:
        ///  ClassName_MethodName_argumentValue1_argumentValue2...._argumentValueN
        /// </summary>
        /// <remarks>
        /// Returns a hashed GUID of the input, so any size input will be a 16-characetr key
        /// </remarks>
        /// <param name="input"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        public static string GetCacheKey(IMethodInvocation input)
        {
            var prefix    = GetCacheKeyPrefix(input) + "_";
            var key       = input.ToTraceString(prefix);
            var hashedKey = HashCacheKey(key);

            return(hashedKey);
        }
Example #2
0
 /// <summary>
 /// Builds a full cache key in the format:
 ///  ClassName_MethodName_argumentValue1_argumentValue2...._argumentValueN
 /// </summary>
 /// <remarks>
 /// Returns a hashed GUID of the input, so any size input will be a 16-characetr key
 /// </remarks>
 /// <param name="input"></param>
 /// <param name="serializer"></param>
 /// <returns></returns>
 public static string GetCacheKey(IMethodInvocation input, ISerializer serializer)
 {
     var prefix = GetCacheKeyPrefix(input);
     var key = input.ToTraceString(serializer, prefix);
     var hashedKey = Sixeyed.Caching.CacheKeyBuilder.HashCacheKey(key);
     if (!CacheConfiguration.Current.HashPrefixInCacheKey)
     {
         hashedKey = string.Format("{0}_{1}", prefix, hashedKey);
     }
     Log.Debug("CacheKeyBuilder.GetCacheKey - returned {0}", hashedKey);
     return hashedKey;
 }
        /// <summary>
        /// Builds a full cache key in the format:
        ///  ClassName_MethodName_argumentValue1_argumentValue2...._argumentValueN
        /// </summary>
        /// <remarks>
        /// Returns a hashed GUID of the input, so any size input will be a 16-characetr key
        /// </remarks>
        /// <param name="input"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        public static string GetCacheKey(IMethodInvocation input, ISerializer serializer)
        {
            var prefix    = GetCacheKeyPrefix(input);
            var key       = input.ToTraceString(serializer, prefix);
            var hashedKey = HashCacheKey(key);

            if (!CacheConfiguration.Current.HashPrefixInCacheKey)
            {
                hashedKey = $"{prefix}_{hashedKey}";
            }
            //Log.Debug("CacheKeyBuilder.GetCacheKey - returned {0}", hashedKey);
            return(hashedKey);
        }
Example #4
0
        /// <summary>
        /// Builds a full cache key in the format:
        ///  ClassName_MethodName_argumentValue1_argumentValue2...._argumentValueN
        /// </summary>
        /// <remarks>
        /// Returns a hashed GUID of the input, so any size input will be a 16-characetr key
        /// </remarks>
        /// <param name="input"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        public static string GetCacheKey(IMethodInvocation input, ISerializer serializer)
        {
            var prefix    = GetCacheKeyPrefix(input);
            var key       = input.ToTraceString(serializer, prefix);
            var hashedKey = Sixeyed.Caching.CacheKeyBuilder.HashCacheKey(key);

            if (!CacheConfiguration.Current.HashPrefixInCacheKey)
            {
                hashedKey = string.Format("{0}_{1}", prefix, hashedKey);
            }
            Log.Debug("CacheKeyBuilder.GetCacheKey - returned {0}", hashedKey);
            return(hashedKey);
        }