public static void CorrectlyHandlesNestedProperty()
            {
                Expression <Func <Container <Sale>, string> > groupByFunc = x => x.Value.StoreId;

                string actual = ShouldStartNewAggregateVisitor.Visit(groupByFunc);

                Assert.Equal("current.value.storeId != previous.value.storeId", actual);
            }
            public static void CorrectlyHandlesSingleProperty()
            {
                Expression <Func <Sale, string> > groupByFunc = x => x.StoreId;

                string actual = ShouldStartNewAggregateVisitor.Visit(groupByFunc);

                Assert.Equal("current.storeId != previous.storeId", actual);
            }
コード例 #3
0
        private static string GetShouldStartNewAggregateFunction(QueryExpressions expressions)
        {
            if (expressions.GroupByExpression == null)
            {
                return("return false;");
            }

            return("return " + ShouldStartNewAggregateVisitor.Visit(expressions.GroupByExpression) + ";");
        }