コード例 #1
0
 public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel)
 {
     Log("VisitSelectClause: " + selectClause, logLevel++);
     _queryParts.SelectPart = SqlExpressionTreeVisitor.GetSqlExpression(selectClause.Selector, ",");
     base.VisitSelectClause(selectClause, queryModel);
     logLevel--;
 }
コード例 #2
0
 public override void VisitWhereClause(WhereClause whereClause, QueryModel queryModel, int index)
 {
     Log($"VisitWhereClause({index}): " + whereClause, logLevel++);
     _queryParts.AddWherePart(SqlExpressionTreeVisitor.GetSqlExpression(whereClause.Predicate));
     base.VisitWhereClause(whereClause, queryModel, index);
     logLevel--;
 }
コード例 #3
0
        public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
        {
            Log($"VisitOrderByClause({index}): " + orderByClause, logLevel++);

            var orderings = orderByClause.Orderings;

            _queryParts.AddOrderByPart(orderings.Select(item => SqlExpressionTreeVisitor.GetSqlExpression(item.Expression) + " " + item.OrderingDirection));
            base.VisitOrderByClause(orderByClause, queryModel, index);
            logLevel--;
        }
コード例 #4
0
        private string GetFilter(JoinClause joinClause, string newItemName = null)
        {
            //TODO
            var filter = $"({SqlExpressionTreeVisitor.GetSqlExpression(joinClause.OuterKeySelector)} = {SqlExpressionTreeVisitor.GetSqlExpression(joinClause.InnerKeySelector)})";

            if (newItemName != null)
            {
                filter = filter.Replace($"\"{joinClause.ItemName}\".", $"\"{newItemName}\".");
            }
            return(filter);
        }