protected override void VisitGroup(ConstraintGroup node) { IConstraint where = null; for (int i = 0, c = node.Items.Count; i < c; i++) { this.Visit(node.Items[i]); if (i == 0) { where = _whereResult; } else { string op = node.Operators[i - 1]; if (op == Constraint.AndOperator) { where = f.And(where, _whereResult); } else if (op == Constraint.OrOperator) { where = f.Or(where, _whereResult); } } } _whereResult = where; }
public async Task SaveConstraintGroup(ConstraintGroup constraintGroup) { await _constraintGroupsCollection.ReplaceOneAsync(x => x.Id == constraintGroup.Id, constraintGroup, new UpdateOptions { IsUpsert = true }); }
protected virtual void VisitGroup(ConstraintGroup node) { }