示例#1
0
        /// <summary>
        /// Combines a Term searching the <paramref name="field"/> field for the <paramref name="value"/> Token,
        /// using a logical AND, with another Term generated by the <paramref name="groupSetup"/> Func.
        /// </summary>
        /// <param name="field">The other field to search.</param>
        /// <param name="value">The other value to match.</param>
        /// <param name="groupSetup">
        /// A <see cref="Func{T1,T2}"/> that accepts a <see cref="Term"/> for fluent configuration,
        /// and returns a configured <see cref="Term"/>.
        /// </param>
        /// <returns>
        /// A new <see cref="BinaryTerm"/> based on the two created <see cref="Term"/>s.
        /// </returns>
        public BinaryTerm And(string field, Token value, Func <Term, Term> groupSetup)
        {
            var groupedTerm = groupSetup(new UnaryTerm(search, field, value));
            var groupTerm   = new GroupTerm(search, field, groupedTerm);

            return(new BinaryTerm(search, field, BinaryTerm.Op.And, this, groupTerm));
        }
 /// <summary>
 /// Combines a Term searching the <paramref name="field"/> field for the <paramref name="value"/> Token, 
 /// using a logical AND, with another Term generated by the <paramref name="groupSetup"/> Func.
 /// </summary>
 /// <param name="field">The other field to search.</param>
 /// <param name="value">The other value to match.</param>
 /// <param name="groupSetup">
 /// A <see cref="Func{T1,T2}"/> that accepts a <see cref="Term"/> for fluent configuration,
 /// and returns a configured <see cref="Term"/>. 
 /// </param>
 /// <returns>
 /// A new <see cref="BinaryTerm"/> based on the two created <see cref="Term"/>s.
 /// </returns>
 public BinaryTerm And(string field, Token value, Func<Term, Term> groupSetup)
 {
     var groupedTerm = groupSetup(new UnaryTerm(search, field, value));
     var groupTerm = new GroupTerm(search, field, groupedTerm);
     return new BinaryTerm(search, field, BinaryTerm.Op.And, this, groupTerm);
 }