My problem is quite similar to this post (getting the object out of a memberexpression), however, it is different in that I need to get it from a field.
// how to get 1 from i?
int i = 1;
Expression<Func<int, int, bool>> a = (x1, x2) => x1 == i;
BinaryExpression x = (BinaryExpression)a.Body;
x.Right.//What now?
I cannot use get type.getmember.getvalue as in the linked example because i is a local variable. So how would I extract the value of a field or local variable (not necessarily local to where I am trying to extract)?