flattening support on wrap select.

This commit is contained in:
David Lebee
2018-10-26 16:13:42 -05:00
parent aba20f04e2
commit a7937cd500
3 changed files with 11 additions and 16 deletions
@@ -220,10 +220,16 @@ namespace PoweredSoft.DynamicLinq.Helpers
{
var selectType = parameter.Type.GenericTypeArguments.Skip(1).First();
var innerSelectType = ((LambdaExpression)innerLambdaExpression).ReturnType;
var selectExpression = Expression.Call(typeof(Enumerable), "Select", new Type[] { selectType, innerSelectType }, parameter, innerLambdaExpression);
Expression selectExpression;
if (QueryableHelpers.IsGenericEnumerable(innerSelectType) && selectCollectionHandling == SelectCollectionHandling.Flatten)
selectExpression = Expression.Call(typeof(Enumerable), "SelectMany", new Type[] { selectType, innerSelectType.GenericTypeArguments.First() }, parameter, innerLambdaExpression);
else
selectExpression = Expression.Call(typeof(Enumerable), "Select", new Type[] { selectType, innerSelectType }, parameter, innerLambdaExpression);
return selectExpression;
}
private static Expression CreateSelectExpression(IQueryable query, ParameterExpression parameter, SelectTypes selectType, string path, SelectCollectionHandling selectCollectionHandling, bool nullChecking)
{
if (!IsGrouping(query))
@@ -1,12 +0,0 @@
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
namespace PoweredSoft.DynamicLinq.Helpers
{
public static class QueryablePathHelpers
{
}
}