Retrieving an Expression from a property and adding it to an expression tree
I've tried to simplify this example, as the actual code I'm playing with is more complex. So while this example may seem silly, bear with me. Let's say I'm working with the AdventureWorks database and I decide I want to add a property called Blarg to the Product table that returns an expression that contains code I would like to use in several places: public partial class Product { public Expression<Func<Product, string>> Blarg { get { return product => product.ProductModelID.HasValue ? "Blarg?" : "Blarg!"; } } } What I want to do is create an expression expression tree, have it get the