Example #1
0
        public virtual Task UpdateCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> executedQuery)
        {
            if (executedQuery == null)
            {
                throw new ArgumentNullException(nameof(executedQuery));
            }

            return(executedQuery.UpdateCachedResultAsync(GetAsyncQueryCache <TCacheEntryOptions>()));
        }
Example #2
0
        /// <inheritdoc cref="IAsyncCacheManager.UpdateCachedResultAsync{TCacheEntryOptions}"/>
        public virtual Task UpdateCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> executedQuery, CancellationToken cancellationToken = default)
        {
            if (executedQuery == null)
            {
                throw new ArgumentNullException(nameof(executedQuery));
            }

            return(Decorator.Decorate(GetOperationName(executedQuery, nameof(executedQuery.UpdateCachedResult)), () => executedQuery.UpdateCachedResult(GetAsyncCacheStore <TCacheEntryOptions>(), cancellationToken)));
        }
Example #3
0
        public virtual Task EvictCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            return(query.EvictCachedResultAsync(GetAsyncQueryCache <TCacheEntryOptions>()));
        }
Example #4
0
        /// <inheritdoc cref="IAsyncQueryMediary.QueryAsync{TContext,TCacheEntryOptions,TResult}"/>
        public virtual Task <TResult> QueryAsync <TContext, TCacheEntryOptions, TResult>(IAsyncCachedQuery <TContext, TCacheEntryOptions, TResult> query, TContext context, CacheOption cacheOption, CancellationToken cancellationToken = default)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            return(Decorator.Decorate(GetOperationName(query, nameof(query.Execute)), () => query.Execute(context, GetAsyncCacheStore <TCacheEntryOptions>(), cacheOption, cancellationToken)));
        }
Example #5
0
 public virtual Task UpdateCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> executedQuery)
 {
     return(Invoker.UpdateCachedResultAsync(executedQuery));
 }
Example #6
0
 public virtual Task EvictCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> query)
 {
     return(Invoker.EvictCachedResultAsync(query));
 }
Example #7
0
 public virtual Task <TResult> QueryAsync <TContext, TResult, TCacheEntryOptions>(IAsyncCachedQuery <TContext, TCacheEntryOptions, TResult> query, CacheOption cacheOption = CacheOption.Default)
 {
     return(Invoker.QueryAsync(query, GetContext <TContext>(), cacheOption));
 }
Example #8
0
        public virtual Task <TResult> QueryAsync <TContext, TCacheEntryOptions, TResult>(IAsyncCachedQuery <TContext, TCacheEntryOptions, TResult> query, TContext context, CacheOption cacheOption = CacheOption.Default)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            return(query.ExecuteAsync(context, Decorator, GetAsyncQueryCache <TCacheEntryOptions>(), cacheOption));
        }
Example #9
0
 /// <inheritdoc cref="IAsyncCacheManager.UpdateCachedResultAsync{TCacheEntryOptions}"/>
 public virtual Task UpdateCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> executedQuery, CancellationToken cancellationToken = default) =>
 Mediary.UpdateCachedResultAsync(executedQuery, cancellationToken);
Example #10
0
 /// <inheritdoc cref="IAsyncCacheManager.EvictCachedResultAsync{TCacheEntryOptions}"/>
 public virtual Task EvictCachedResultAsync <TCacheEntryOptions>(IAsyncCachedQuery <TCacheEntryOptions> query, CancellationToken cancellationToken = default) =>
 Mediary.EvictCachedResultAsync(query, cancellationToken);
Example #11
0
 /// <inheritdoc cref="IAsyncQueryMagneto.QueryAsync{TContext,TCacheEntryOptions,TResult}"/>
 public virtual Task <TResult> QueryAsync <TContext, TCacheEntryOptions, TResult>(IAsyncCachedQuery <TContext, TCacheEntryOptions, TResult> query, CacheOption cacheOption, CancellationToken cancellationToken = default) =>
 Mediary.QueryAsync(query, GetContext <TContext>(), cacheOption, cancellationToken);