示例#1
0
        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);
        }
示例#2
0
        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();
        }
示例#3
0
 public SelectWhereComparison(SelectWhereColumnBase leftExpression, SelectWhereComparisonOperatorEnum @operator, SelectWhereColumnBase rightEpression)
 {
     LeftExpression  = leftExpression;
     Operator        = @operator;
     RightExpression = rightEpression;
 }
示例#4
0
 public SelectWhereNull(SelectWhereColumnBase expression)
 {
     Expression = expression;
 }
示例#5
0
 public SelectWhereLike(SelectWhereColumnBase leftExpression, SelectWhereColumnBase rightExpression)
 {
     LeftExpression  = leftExpression;
     RightExpression = rightExpression;
 }