示例#1
0
        public string GetCacheKey(CacheKeyParts content)
        {
            //todo now: serialize this instead.
            var param          = string.Join(",", content.Parameters.Keys) + "|" + string.Join(",", content.Parameters.Values);
            var parametersKey  = param;
            var widgetTypeCode = content.WidgetType.AssemblyQualifiedName;

            return("by-parameters-" + widgetTypeCode + "-" + parametersKey);
        }
        public string GetCacheKey(CacheKeyParts parts)
        {
            var genInterface   = typeof(ISupportsCache <>);
            var cacheInterface =
                parts.WidgetType.GetInterfaces()
                .Where(x => x.IsGenericType)
                .Single(x => x.GetGenericTypeDefinition() == genInterface);

            var cacheDirector   = cacheInterface.GetGenericArguments().Single();
            var cacheKeyFactory = (ICmsPageContentCacheKeyFactory)Dependency.Resolve(cacheDirector);

            return(cacheKeyFactory.GetCacheKey(parts));
        }
示例#3
0
        public string GetCacheKey(CacheKeyParts content)
        {
            var widgetTypeCode = content.WidgetType.AssemblyQualifiedName;

            return("by-instance-" + widgetTypeCode + "-" + content.ContentId);
        }