Ejemplo n.º 1
0
        public void HasChild <K>(Action <HasChildFilterDescriptor <K> > querySelector) where K : class
        {
            var descriptor = new HasChildFilterDescriptor <K>();

            querySelector(descriptor);
            this.HasChildFilter = descriptor;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The has_child filter accepts a query and the child type to run against,
        /// and results in parent documents that have child docs matching the query.
        /// </summary>
        /// <typeparam name="K">Type of the child</typeparam>
        public FilterContainer HasChild <K>(Action <HasChildFilterDescriptor <K> > filterSelector) where K : class
        {
            var filter = new HasChildFilterDescriptor <K>();

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

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