/// <summary> /// Initializes a new instance of the <see cref="LogicalJoinModel"/>. /// </summary> /// <param name="logicalOperator">Logical operator.</param> /// <param name="first">First operand.</param> /// <param name="second">Second operand.</param> /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> is null.</exception> public LogicalJoinModel(LogicalJoinOperator logicalOperator, [NotNull] WhereModel first, [NotNull] WhereModel second) : base(WhereType.LogicalJoin) { Guard.CheckNotNull(nameof(first), first); Guard.CheckNotNull(nameof(second), second); LogicalOperator = logicalOperator; First = first; Second = second; }
public static WhereModel Or([CanBeNull] WhereModel left, [CanBeNull] WhereModel right) { if (left == null) { return(right); } if (right == null) { return(left); } return(new LogicalJoinModel(LogicalJoinOperator.Or, left, right)); }
/// <summary> /// Merge current CAML where operation with new one. /// </summary> /// <param name="where">New Where operation to merge.</param> public void MergeWheres([CanBeNull] WhereModel where) { Where = WhereModel.And(Where, @where); }