I
I
iloyd2021-03-21 13:40:53
.NET
iloyd, 2021-03-21 13:40:53

How to parse and get the desired values ​​from Expression?

The essence of the question is as follows:
1. There is a method

void AddExpression<T>(Expression<Func<T, bool>> expression)
{
      throw new NotImplementedException();
}

2. For example, I call this method as follows: How can I find out the property of the object T, the type of the logical expression, and the value against which the comparison is made inside this method?
AddExpression(x => x.Property > 5);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eRKa, 2021-03-21
@iloyd

It's all in the documentation Parsing Expression Trees

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question