1

Given:

Expression<Func<T1, T2>> x = ...;   // an example might be: a => a.DailyEmail
Expression<Func<T2, bool>> y = ...; // an example might be: a => a.Last < DateTime.Now

Where x contains only a member reference whereas y may contain any expression, what would be the best way to join the two together so that I get a new Expression<Func<T1, bool>> that contains the member reference from x to obtain a T2 and then the expression from y that turns that T2 into a bool?

Note: I need an expression as the result, not the actual variable. Thus I cannot compile the two expressions individually and call them both against a known T1.

David Pfeffer
  • 38,869
  • 30
  • 127
  • 202

0 Answers0