null type resolving.

This commit is contained in:
David Lebee 2018-04-05 19:40:33 -05:00
parent 3b9494d510
commit 65294edebc
2 changed files with 13 additions and 0 deletions

View File

@ -97,6 +97,8 @@ namespace PoweredSoft.DynamicLinq.ConsoleApp
// group the piece by common parameters // group the piece by common parameters
var groups = Parser.GroupBySharedParameters(); var groups = Parser.GroupBySharedParameters();
var nullType = groups.ResolveNullHandlingType();
Expression currentExpression = null; Expression currentExpression = null;
groups.ReversedForEach(group => groups.ReversedForEach(group =>
{ {

View File

@ -28,5 +28,16 @@ namespace PoweredSoft.DynamicLinq.Parser
{ {
return group.Pieces.Last().EnumerableType; return group.Pieces.Last().EnumerableType;
} }
public static Type ResolveNullHandlingType(this List<ExpressionParserPieceGroup> groups)
{
if (groups.Count() == 1)
{
throw new NotImplementedException();
}
var type = groups.Last().Pieces.Last().Type;
return typeof(IEnumerable<>).MakeGenericType(type);
}
} }
} }