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))); } }
protected virtual Task InvalidateQueryCacheAsync(CommandContext context, Type queryType, CancellationToken cancellationToken) { return(Cache.RemoveScopeAsync(QueryCacherInterceptor.GetCacheScope(queryType), cancellationToken)); }