public static SelectWhereColumnBase ParseWhereColumn(string name) { SelectWhereColumnBase columnBase = null; int number; if (name.IsQuoted() || int.TryParse(name, out number)) { columnBase = new SelectWhereRawColumn(name); } else if (char.IsLetter(name[0])) { columnBase = new SelectWhereFieldColumn(name); } return(columnBase); }
private string GetWhereClauseAttributeName(SelectWhereColumnBase whereColumn) { switch (whereColumn.Type) { case SelectColumnTypeEnum.Field: var fieldColumn = (SelectWhereFieldColumn)whereColumn; return(fieldColumn.Name); case SelectColumnTypeEnum.Raw: var rawColumn = (SelectWhereRawColumn)whereColumn; return(rawColumn.Value.CleanRaw()); } throw new NotSupportedException(); }
public SelectWhereComparison(SelectWhereColumnBase leftExpression, SelectWhereComparisonOperatorEnum @operator, SelectWhereColumnBase rightEpression) { LeftExpression = leftExpression; Operator = @operator; RightExpression = rightEpression; }
public SelectWhereNull(SelectWhereColumnBase expression) { Expression = expression; }
public SelectWhereLike(SelectWhereColumnBase leftExpression, SelectWhereColumnBase rightExpression) { LeftExpression = leftExpression; RightExpression = rightExpression; }