How do I create a generic Expression that has an expression as a parameter
问题 There is a DisplayNameFor(x=>x.Title) helper in ASP.Net MVC. I want to implement something similar in behavior. I want to have a method that accepts an expression based on User class ( u=>u.Birthdate or u=>u.Name), a operand (Greater, Less, Equal) and a value like DateTime.Now and returns an expression u=>u.Birthdate > DateTime.Now I understand that I'll have to build resulting expression manually from pieces. What i can't wrap my head around is passing in and handling of property expression.