コード例 #1
0
 internal override TResult ExecuteInternal <TResult>(Func <Context, CancellationToken, TResult> action, Context context, CancellationToken cancellationToken)
 {
     return(CacheEngine.Implementation <TResult>(
                _syncCacheProvider.For <TResult>(),
                _ttlStrategy.For <TResult>(),
                _cacheKeyStrategy,
                action,
                context,
                cancellationToken,
                _onCacheGet,
                _onCacheMiss,
                _onCachePut,
                _onCacheGetError,
                _onCachePutError));
 }
コード例 #2
0
        internal override TResult ExecuteInternal <TResult>(Func <Context, CancellationToken, TResult> action, Context context, CancellationToken cancellationToken)
        {
            if (_syncCacheProvider == null)
            {
                throw new InvalidOperationException("Please use the synchronous-defined policies when calling the synchronous Execute (and similar) methods.");
            }

            return(CacheEngine.Implementation <TResult>(
                       _syncCacheProvider.For <TResult>(),
                       _ttlStrategy.For <TResult>(),
                       _cacheKeyStrategy,
                       action,
                       context,
                       cancellationToken,
                       _onCacheGet,
                       _onCacheMiss,
                       _onCachePut,
                       _onCacheGetError,
                       _onCachePutError));
        }