Is there an easy way to find out if an expression contains a ParameterExpression expression that is not completed, such as MemberExpression.
Example:
x => x.Method() ? x : null x => x.Method() ? x : null <= 1 occurrence x without additional evaluation
x => x.Method() ? x.Property : null x => x.Method() ? x.Property : null <= 0 occurrences of x without any further evaluation
Simply put, my use case is that I know the Method (no params) and Property parameters and want to know if this is enough to evaluate the expression without selecting the entire “object” from the repository.
Edit: My example may be simplified. There are more types of expressions that need to be processed (for example, UnaryExpression).
x => ((Cast) x).Property <= 0 occurrences of x without additional evaluation
I am looking for the answer to the following question:
for an expression, if I know all the return values of the method and the property values of the input parameter, but not the parameter value itself, can I evaluate the expression?
lindstromhenrik
source share