Пример #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;
 }