/// <summary> /// Negates the <paramref name="rightHandSide" /> using /// the logical <c>NOT</c> operator, then combines both /// <see cref="Expression" />s using the logical /// <c>AND</c> operator. /// </summary> /// /// <typeparam name="TDelegate"> /// The <see cref="Type" /> of <see cref="Func{TResult}"/> /// the <see cref="Expression" />s wrap. /// </typeparam> /// /// <param name="leftHandSide"> /// The <see cref="Expression" /> on the left-hand /// side of the operator. /// </param> /// /// <param name="rightHandSide"> /// The <see cref="Expression" /> on the right-hand /// side of the operator. /// </param> /// /// <returns> /// An <see cref="Expression" />s consisting of the /// <paramref name="rightHandSide" /> that has been /// negated with the logical <c>NOT</c> operator /// combined with the <paramref name="leftHandSide" /> /// using the logical <c>AND</c> operator. /// </returns> public static Expression <TDelegate> AndNot <TDelegate>(this Expression <TDelegate> leftHandSide, Expression <TDelegate> rightHandSide) => ExpressionExtensions.Compose(leftHandSide, ExpressionExtensions.Not(rightHandSide), Expression.And) ;
/// <summary> /// Combines two <see cref="Expression" />s using the /// logical <c>OR</c> operator. /// </summary> /// /// <typeparam name="TDelegate"> /// The <see cref="Type" /> of <see cref="Func{TResult}"/> /// the <see cref="Expression" />s wrap. /// </typeparam> /// /// <param name="leftHandSide"> /// The <see cref="Expression" /> on the left-hand /// side of the operator. /// </param> /// /// <param name="rightHandSide"> /// The <see cref="Expression" /> on the right-hand /// side of the operator. /// </param> /// /// <returns> /// An <see cref="Expression" /> consisting of the /// <paramref name="leftHandSide" /> and the /// <paramref name="rightHandSide" /> combined using /// the logical <c>OR</c> operator. /// </returns> public static Expression <TDelegate> Or <TDelegate>(this Expression <TDelegate> leftHandSide, Expression <TDelegate> rightHandSide) => ExpressionExtensions.Compose(leftHandSide, rightHandSide, Expression.Or) ;