week1
and week2
have different parameters, because they are created separately. The easiest way would be to use ExpressionInvoke
on your existing expressions, with new ExpressionParameter
instance:
var param = Expression.Parameter(typeof(Appointment));
var weekOr = Expression.Or(Expression.Invoke(week1, param), Expression.Invoke(week2, param));
var week = Expression.Lambda<Func<Appointment, bool>>(weekOr, param).Compile();