Beispiel #1
0
            public override IEnumerable <string> GetScopes(QueryContext context)
            {
                yield return(QueryCacherInterceptor.GetCacheScope(context.QueryType));

                var query = (TQuery)context.Query;

                for (int i = 0, n = ScopeSelectors.Length; i < n; i++)
                {
                    yield return(QueryCacherInterceptor.GetCacheScope(context.QueryType, ScopeSelectors[i](query)));
                }
            }
Beispiel #2
0
 protected virtual Task InvalidateQueryCacheAsync(CommandContext context, Type queryType, CancellationToken cancellationToken)
 {
     return(Cache.RemoveScopeAsync(QueryCacherInterceptor.GetCacheScope(queryType), cancellationToken));
 }