コード例 #1
0
        public static void ReWrite(QueryModel queryModel)
        {
            var subQueryExpression = queryModel.MainFromClause.FromExpression as SubQueryExpression;

            if ((subQueryExpression != null) &&
                (subQueryExpression.QueryModel.ResultOperators.Count() == 1) &&
                (subQueryExpression.QueryModel.ResultOperators[0] is GroupResultOperator) &&
                (IsNonAggregatingGroupBy(queryModel)))
            {
                var rewriter = new NonAggregatingGroupByRewriter();
                rewriter.FlattenSubQuery(subQueryExpression, queryModel.MainFromClause, queryModel);
            }
        }
コード例 #2
0
		public static void ReWrite(QueryModel queryModel)
		{
			var subQueryExpression = queryModel.MainFromClause.FromExpression as SubQueryExpression;

			if ((subQueryExpression != null) &&
			    (subQueryExpression.QueryModel.ResultOperators.Count() == 1) &&
			    (subQueryExpression.QueryModel.ResultOperators[0] is GroupResultOperator) &&
			    (IsNonAggregatingGroupBy(queryModel)))
			{
				var rewriter = new NonAggregatingGroupByRewriter();
				rewriter.FlattenSubQuery(subQueryExpression, queryModel.MainFromClause, queryModel);
			}
		}
コード例 #3
0
		public static void ReWrite(QueryModel queryModel)
		{
			if (queryModel.ResultOperators.Count == 1 
				&& queryModel.ResultOperators[0] is GroupResultOperator 
				&& IsNonAggregatingGroupBy(queryModel))
			{
				var resultOperator = (GroupResultOperator)queryModel.ResultOperators[0];
				queryModel.ResultOperators.Clear();
				queryModel.ResultOperators.Add(new NonAggregatingGroupBy(resultOperator));
				return;
			}

			var subQueryExpression = queryModel.MainFromClause.FromExpression as SubQueryExpression;

			if ((subQueryExpression != null) 
				&& (subQueryExpression.QueryModel.ResultOperators.Count == 1) 
				&& (subQueryExpression.QueryModel.ResultOperators[0] is GroupResultOperator) 
				&& (IsNonAggregatingGroupBy(queryModel)))
			{
				var rewriter = new NonAggregatingGroupByRewriter();
				rewriter.FlattenSubQuery(subQueryExpression, queryModel);
			}
		}
コード例 #4
0
        public static void ReWrite(QueryModel queryModel)
        {
            if (queryModel.ResultOperators.Count == 1 &&
                queryModel.ResultOperators[0] is GroupResultOperator &&
                IsNonAggregatingGroupBy(queryModel))
            {
                var resultOperator = (GroupResultOperator)queryModel.ResultOperators[0];
                queryModel.ResultOperators.Clear();
                queryModel.ResultOperators.Add(new NonAggregatingGroupBy(resultOperator));
                return;
            }

            var subQueryExpression = queryModel.MainFromClause.FromExpression as SubQueryExpression;

            if ((subQueryExpression != null) &&
                (subQueryExpression.QueryModel.ResultOperators.Count == 1) &&
                (subQueryExpression.QueryModel.ResultOperators[0] is GroupResultOperator) &&
                (IsNonAggregatingGroupBy(queryModel)))
            {
                var rewriter = new NonAggregatingGroupByRewriter();
                rewriter.FlattenSubQuery(subQueryExpression, queryModel);
            }
        }