advancing well :) I think I might have it this time.

This commit is contained in:
David Lebee 2018-04-02 11:57:46 -05:00
parent f0ed7d9bd5
commit 4e6dda09b5

View File

@ -26,8 +26,15 @@ namespace PoweredSoft.DynamicLinq.ConsoleApp
*/ */
public static void Run() public static void Run()
{ {
// the expression parser.
var ep = new ExpressionParser(typeof(Author), "Posts.Comments.Id"); var ep = new ExpressionParser(typeof(Author), "Posts.Comments.Id");
ep.Parse();
// the builder.
var per = new PathExpressionResolver(ep);
per.Resolve();
// the result expression.
var result = per.Result;
} }
} }
@ -41,6 +48,24 @@ namespace PoweredSoft.DynamicLinq.ConsoleApp
public Type EnumerableType => MemberExpression.Type.GenericTypeArguments.FirstOrDefault(); public Type EnumerableType => MemberExpression.Type.GenericTypeArguments.FirstOrDefault();
} }
public class PathExpressionResolver
{
public SelectNullHandling NullChecking { get; set; } = SelectNullHandling.LeaveAsIs;
public SelectCollectionHandling CollectionHandling { get; set; } = SelectCollectionHandling.LeaveAsIs;
public ExpressionParser Parser { get; protected set; }
public Expression Result { get; protected set; }
public PathExpressionResolver(ExpressionParser parser)
{
Parser = parser;
}
public void Resolve()
{
}
}
public class ExpressionParser public class ExpressionParser
{ {
public ParameterExpression Parameter { get; protected set; } public ParameterExpression Parameter { get; protected set; }