/// <summary>Adds or get the filter context associated with the context.</summary>
        /// <param name="context">The context associated with the filter context.</param>
        /// <returns>The filter context associated with the context.</returns>
        public static QueryFilterContextInterceptor AddOrGetFilterContext(DbContext context)
        {
            QueryFilterContextInterceptor filterContext;

            if (!CacheWeakFilterContext.TryGetValue(context, out filterContext))
            {
                filterContext = new QueryFilterContextInterceptor(context)
                {
                    GlobalFilterByKey  = GlobalFiltersByKey,
                    GlobalFilterByType = GlobalFilterByType
                };
                CacheWeakFilterContext.Add(context, filterContext);
            }

            return(filterContext);
        }