private QWhereCondition AddCondition(QCondition condition, WhereType type) { if (whereType == WhereType.None) { if (condition is QWhereCondition) { return((QWhereCondition)condition); } whereType = WhereType.Single; leftCondition = condition; return(this); } if (whereType == WhereType.Single) { whereType = type; rightCondition = condition; if (rightCondition is QWhereCondition) { rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or; } return(this); } var where = new QWhereCondition(); where.whereType = type; where.leftCondition = this; where.rightCondition = condition; where.leftHasOr = this.whereType == WhereType.Or; if (rightCondition is QWhereCondition) { where.rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or; } return(where); }
public void Where(QCondition @where) { if (_jump) { _jump = false; return; } whereCondition = whereCondition.And(@where); }
public void Having(QCondition having) { if (_jump) { _jump = false; return; } _having.Add(having); }
internal QWhereCondition And(QCondition condition) { return(AddCondition(condition, WhereType.And)); }
/// <summary> /// /// </summary> /// <param name="c1"></param> /// <param name="whereType"></param> /// <param name="c2"></param> internal QWhereCondition(QCondition c1, WhereType whereType, QCondition c2) { leftCondition = c1; this.whereType = whereType; rightCondition = c2; }
internal QWhereCondition Or(QCondition condition) { return(AddCondition(condition, WhereType.Or)); }
public QWhereCondition Or(QCondition condition) { return(AddCondition(condition, WhereType.Or)); }
public QWhereCondition And(QCondition condition) { return(AddCondition(condition, WhereType.And)); }