Beispiel #1
0
        /// <summary>
        ///  A nested filter, works in a similar fashion to the nested query, except used as a filter.
        ///  It follows exactly the same structure, but also allows to cache the results
        ///  (set _cache to true), and have it named (set the _name value).
        /// </summary>
        /// <param name="selector"></param>
        public void Nested(Action <NestedFilterDescriptor <T> > selector)
        {
            var descriptor = new NestedFilterDescriptor <T>();

            selector(descriptor);
            this.NestedFilter = descriptor;
            this.SetCacheAndName(this.NestedFilter);
        }
Beispiel #2
0
        /// <summary>
        ///  A nested filter, works in a similar fashion to the nested query, except used as a filter.
        ///  It follows exactly the same structure, but also allows to cache the results
        ///  (set _cache to true), and have it named (set the _name value).
        /// </summary>
        /// <param name="selector"></param>
        public FilterContainer Nested(Action <NestedFilterDescriptor <T> > selector)
        {
            var filter = new NestedFilterDescriptor <T>();

            if (selector != null)
            {
                selector(filter);
            }

            return(this.New(filter, f => f.Nested = filter));
        }