Пример #1
0
        /// <summary>
        /// Creates a first predicate operator query expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
        /// </summary>
        /// <param name="source">The <see cref="Source"/> child node of the result.</param>
        /// <param name="predicate">The <see cref="Predicate"/> child node of the result.</param>
        /// <returns>This query expression if no children are changed or an expression with the updated children.</returns>
        public FirstPredicateOperator Update(MonadMember source, QueryTree predicate)
        {
            if (source == Source && predicate == Predicate)
            {
                return(this);
            }

            return(QueryExpressionFactory.First(ElementType, source, predicate));
        }
Пример #2
0
        /// <summary>
        /// Creates a first operator query expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
        /// </summary>
        /// <param name="source">The <see cref="Source"/> child node of the result.</param>
        /// <returns>This query expression if no children are changed or an expression with the updated children.</returns>
        public FirstOperator Update(MonadMember source)
        {
            if (source == Source)
            {
                return(this);
            }

            return(QueryExpressionFactory.First(ElementType, source));
        }