diff --git a/PoweredSoft.DynamicLinq.ConsoleApp/BetterProto2.cs b/PoweredSoft.DynamicLinq.ConsoleApp/BetterProto2.cs index a3db12b..00ffb86 100644 --- a/PoweredSoft.DynamicLinq.ConsoleApp/BetterProto2.cs +++ b/PoweredSoft.DynamicLinq.ConsoleApp/BetterProto2.cs @@ -48,12 +48,14 @@ namespace PoweredSoft.DynamicLinq.ConsoleApp // the expression parser. var ep = new ExpressionParser(typeof(Post), "Author.Posts.Author.FirstName"); - /* - var esl = new List(); - new List().AsQueryable().Select(t => new + new List().AsQueryable().Select(t => new { - FirstNames = (t.Author == null ? esl : (t.Author.Posts == null ? esl : t.Author.Posts.Select(t2 => t2.Author == null ? string.Empty : t2.Author.FirstName))) - });*/ + FirstNames = t.Author == null ? new List() : (t.Author.Posts == null ? new List() : t.Author.Posts.Where(t2 => t2.Author != null).Select(t2 => t2.Author.FirstName)), + Comments = t.Comments == null ? new List() : t.Comments, + CommentLikes = (t.Comments == null ? new List() : t.Comments.Where(t2 => t2.CommentLikes != null).SelectMany(t2 => t2.CommentLikes)), + CommentLikeIds = (t.Comments == null ? new List() : t.Comments.Where(t2 => t2.CommentLikes != null).SelectMany(t2 => t2.CommentLikes.Select(t3 => t3.Id))), + CommentsLikes = (t.Comments == null ? new List>() : t.Comments.Where(t2 => t2.CommentLikes != null).Select(t2 => t2.CommentLikes)) + }); // the builder. var per = new PathExpressionResolver(ep); @@ -128,7 +130,7 @@ namespace PoweredSoft.DynamicLinq.ConsoleApp private void HandleCollection(ExpressionParserPiece piece, int index) { - Parser.Pieces. + /* if (Result == null)