예제 #1
0
        private string CreateOrderByString(OrderByStatement orderByStatement, string tableName, Func <string, string> escape)
        {
            var direction       = orderByStatement.Direction == OrderByDirection.Ascending ? "" : " DESC";
            var columnReference = new ColumnReference(orderByStatement.PropertyName, tableName, escape);

            return(columnReference + direction);
        }
예제 #2
0
        private string CreateColumnSelectString(string columnName, AliasedSqlSubQuery subQuery)
        {
            var alias           = string.Format("{0} {1}", subQuery.TableIdentifier, columnName);
            var columnReference = new ColumnReference(columnName, subQuery.TableIdentifier, Escape);

            return(string.Format("{0} AS \"{1}\"", columnReference, alias));
        }
예제 #3
0
        private string CreateOrderByString(OrderByStatement orderByStatement, string tableName, Func<string, string> escape)
        {
            var direction = orderByStatement.Direction == OrderByDirection.Ascending ? "" : " DESC";
            var columnReference = new ColumnReference(orderByStatement.PropertyName, tableName, escape);

            return columnReference + direction;
        }
예제 #4
0
 public void Visit(PropertyExpression expression)
 {
     if (expression.PropertyType == typeof(bool))
     {
         var columnName      = expression.PropertyName;
         var columnReference = new ColumnReference(columnName, Escape);
         ConstraintCommandText = string.Format("{0} = 1", columnReference);
     }
 }
예제 #5
0
 public void Visit(EqualsExpression expression)
 {
     if (expression.ValueExpression.Value == null)
     {
         var columnName      = expression.PropertyExpression.PropertyName;
         var columnReference = new ColumnReference(columnName, Escape);
         ConstraintCommandText = string.Format("{0} IS NULL", columnReference);
     }
     else
     {
         VisitBinaryComparisonExpression(expression, "=");
     }
 }