Beispiel #1
0
        internal static void CacheNodeData(NodeData nodeData, string cacheKey = null)
        {
            if (nodeData == null)
            {
                throw new ArgumentNullException("nodeData");
            }
            if (cacheKey == null)
            {
                cacheKey = GenerateNodeDataVersionIdCacheKey(nodeData.VersionId);
            }
            var dependency = CacheDependencyFactory.CreateNodeDataDependency(nodeData);

            DistributedApplication.Cache.Insert(cacheKey, nodeData, dependency);
        }
Beispiel #2
0
        public void CacheNodeData(NodeData nodeData, string cacheKey = null)
        {
            if (nodeData == null)
            {
                throw new ArgumentNullException(nameof(nodeData));
            }
            if (cacheKey == null)
            {
                cacheKey = CreateNodeDataVersionIdCacheKey(nodeData.VersionId);
            }
            var dependency = CacheDependencyFactory.CreateNodeDataDependency(nodeData);

            Cache.Insert(cacheKey, nodeData, dependency);
        }