Is there any way to pull out the properties, the operator and matching value from an Expression<Func<T>,bool>
? Given the following example:
var customers = GetCustomers();
var customerQuery = customers.Where(x=> x.CustomerID == 1
&& x.CustomerName == "Bob"); // The query is for illustration only
I need to be able to get out something like the following:
Property: CustomerID
Operator: Equals
Value: 1
Property: CustomerName
Operator: Equals
Value: Bob
I've already written something that can pull out the property name of an Expression, but I cannot seem to find out where the value and operator are held, although it's quite clearly visible in the Expression's DebugView property.