better names
This commit is contained in:
parent
5568d15075
commit
3ca718da52
@ -97,42 +97,42 @@ namespace PoweredSoft.DynamicLinq.ConsoleApp
|
|||||||
// group the piece by common parameters
|
// group the piece by common parameters
|
||||||
var groups = Parser.GroupBySharedParameters();
|
var groups = Parser.GroupBySharedParameters();
|
||||||
|
|
||||||
Expression ce = null;
|
Expression currentExpression = null;
|
||||||
groups.ReversedForEach(group =>
|
groups.ReversedForEach(group =>
|
||||||
{
|
{
|
||||||
if (ce == null)
|
if (currentExpression == null)
|
||||||
{
|
{
|
||||||
var ge = group.CompileGroup(NullHandling);
|
var groupExpression = group.CompileGroup(NullHandling);
|
||||||
var gl = Expression.Lambda(ge, group.Parameter);
|
var groupExpressionLambda = Expression.Lambda(groupExpression, group.Parameter);
|
||||||
|
|
||||||
if (group.Parent == null)
|
if (group.Parent == null)
|
||||||
{
|
{
|
||||||
ce = gl;
|
currentExpression = groupExpressionLambda;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent = group.Parent;
|
var parent = group.Parent;
|
||||||
var parentExpression = parent.CompileGroup(NullHandling);
|
var parentExpression = parent.CompileGroup(NullHandling);
|
||||||
var selectType = parent.GroupEnumerableType();
|
var selectType = parent.GroupEnumerableType();
|
||||||
var select = Expression.Call(typeof(Enumerable), "Select",
|
var selectExpression = Expression.Call(typeof(Enumerable), "Select",
|
||||||
new Type[] { selectType, ge.Type },
|
new Type[] { selectType, groupExpression.Type },
|
||||||
parentExpression, gl);
|
parentExpression, groupExpressionLambda);
|
||||||
ce = select;
|
currentExpression = selectExpression;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (group.Parent == null)
|
if (group.Parent == null)
|
||||||
{
|
{
|
||||||
ce = Expression.Lambda(ce, group.Parameter);
|
currentExpression = Expression.Lambda(currentExpression, group.Parameter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent = group.Parent;
|
var parent = group.Parent;
|
||||||
var parentExpression = parent.CompileGroup(NullHandling);
|
var parentExpression = parent.CompileGroup(NullHandling);
|
||||||
var selectType = parent.GroupEnumerableType();
|
var selectType = parent.GroupEnumerableType();
|
||||||
var currentExpressionLambda = Expression.Lambda(ce, group.Parameter);
|
var currentExpressionLambda = Expression.Lambda(currentExpression, group.Parameter);
|
||||||
ce = Expression.Call(typeof(Enumerable), "Select",
|
currentExpression = Expression.Call(typeof(Enumerable), "Select",
|
||||||
new Type[] { selectType, ce.Type },
|
new Type[] { selectType, currentExpression.Type },
|
||||||
parentExpression, currentExpressionLambda);
|
parentExpression, currentExpressionLambda);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user