Skip to content
Permalink
Browse files

Use constants for aggregate element (mistakenly undone)

  • Loading branch information...
a046 committed Feb 25, 2019
1 parent 83dbe73 commit 1232c8b67032f27d24985c411e6a6fe94cc4c3e4
@@ -508,8 +508,8 @@ public static AggregateElement GroupBy(Type resultType, LambdaExpression keySele

var expressions = new List<KeyValuePair<string, LambdaExpression>>
{
new KeyValuePair<string, LambdaExpression>("KeySelector", keySelector),
new KeyValuePair<string, LambdaExpression>("ElementSelector", elementSelector)
new KeyValuePair<string, LambdaExpression>(AggregateElement.KeySelectorName, keySelector),
new KeyValuePair<string, LambdaExpression>(AggregateElement.ElementSelectorName, elementSelector)
};
var element = Aggregate(resultType, AggregateElement.GroupByName, expressions, source);
return element;
@@ -546,7 +546,7 @@ public static AggregateElement Project(Type resultType, LambdaExpression selecto

var expressions = new List<KeyValuePair<string, LambdaExpression>>
{
new KeyValuePair<string, LambdaExpression>("Selector", selector)
new KeyValuePair<string, LambdaExpression>(AggregateElement.SelectorName, selector)
};
var element = Aggregate(resultType, AggregateElement.ProjectName, expressions, source);
return element;
@@ -566,7 +566,7 @@ public static AggregateElement Flatten(Type resultType, LambdaExpression selecto

var expressions = new List<KeyValuePair<string, LambdaExpression>>
{
new KeyValuePair<string, LambdaExpression>("Selector", selector)
new KeyValuePair<string, LambdaExpression>(AggregateElement.SelectorName, selector)
};
var element = Aggregate(resultType, AggregateElement.FlattenName, expressions, source);
return element;
@@ -129,7 +129,7 @@ public static void ValidateGroupByAggregate(AggregateElement element)
$"KeySelector={keySelector}, ExpectedType={sourceType}, ActualType={keySelector.Parameters[0].Type}");
}

var elementSelector = element.Expressions["ElementSelector"].Expression;
var elementSelector = element.Expressions[AggregateElement.ElementSelectorName].Expression;
if (elementSelector.Parameters.Count == 0)
{
throw new ArgumentException(

0 comments on commit 1232c8b

Please sign in to comment.
You can’t perform that action at this time.