Exemple #1
0
        public virtual TResult Query <TContext, TCacheEntryOptions, TResult>(ISyncCachedQuery <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.Execute(context, Decorator, GetSyncQueryCache <TCacheEntryOptions>(), cacheOption));
        }
Exemple #2
0
        /// <inheritdoc cref="ISyncQueryMediary.Query{TContext,TCacheEntryOptions,TResult}"/>
        public virtual TResult Query <TContext, TCacheEntryOptions, TResult>(ISyncCachedQuery <TContext, TCacheEntryOptions, TResult> query, TContext context, CacheOption cacheOption)
        {
            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, GetSyncCacheStore <TCacheEntryOptions>(), cacheOption)));
        }