Expression.Lambda and query generation at runtime, nested property “Where” example
I found very nice answer on a question about building Expression Tree for Where query. Expression.Lambda and query generation at runtime, simplest "Where" example Can someone help me and show me how this example could be implemented in the scenario with nested property. I mean instead of: var result = query.Where(item => item.Name == "Soap") With that solution: var item = Expression.Parameter(typeof(Item), "item"); var prop = Expression.Property(item, "Name"); var soap = Expression.Constant("Soap"); var equal = Expression.Equal(prop, soap); var lambda = Expression.Lambda<Func<Item, bool>>