I finally found time to work on DevExamples.com again and thought I would check on the suggestion that Richard had left on Got my nice Urls working about using incremental LINQ.
Overall I found that I liked the following syntax much better
var cats = this.Categories.Where(c => c.Name == navList.First().Value); foreach (var item in navList.Skip(1)) { string name = item.Value; cats = cats.Where(c => c.Name == name); } cat = cats.First();
Unfortunately this only works for the first parent in the hierarchy. After the first parent, it continues to simply work off of the single join. The problem is that instead of generating
it is generating
I think I understand why I am getting this result, though it was not what I was hoping.
In the end I think I will stick with how I implemented it in Got my nice Urls working until I either think of, or run into, a way to do it with lambda expression. Plus I like the Sql generated in the previous post a little better mostly for trace readability.