Answer the question
In order to leave comments, you need to log in
How to get the value of a ParameterExpression?
I need to upgrade Ef Core (5). There is some function in the request, which should not be translated into a database function, but turned into a different construct (Expression).
To do this, I intercepted the traversal of the entire expression through the substitution of EF services.
The problem is that the function takes some object as a parameter and in my visitor I get a MethodCallExpression with a ParameterExpression that contains the parameter name and type. And to build the correct expression, I need the value of this parameter.
Here is an example request code
var myObject = new SomeObject();
ctx.MyEntity
.Where(x => x.MyFunction(myObject))
.ToList();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question