コード例 #1
0
ファイル: ContentCache.cs プロジェクト: robertjf/Umbraco-CMS
    public IPublishedContent?GetByRoute(bool preview, string route, bool?hideTopLevelNode = null, string?culture = null)
    {
        if (route == null)
        {
            throw new ArgumentNullException(nameof(route));
        }

        IAppCache?cache = preview == false || PublishedSnapshotService.FullCacheWhenPreviewing
            ? _elementsCache
            : _snapshotCache;
        var key = CacheKeys.ContentCacheContentByRoute(route, preview, culture);

        return(cache?.GetCacheItem(key, () => GetByRouteInternal(preview, route, hideTopLevelNode, culture)));
    }