I'm trying to use the DynamicExpression
class to parse a string and get an expression tree.
This works fine for simple cases, but when the input string contains a Select()
command, this gives me the error "No applicable aggregate method 'Select' exists".
For example, let's say I want to build the expression tree below:
x => x.MyCollection.Select(y => y.SomeInt)
If I pass the string "x.MyCollection.Select(SomeInt)"
to the ParseLambda
method, I get the error mentioned above.
Does anyone know to get around this or give me an alternative to transform a string to a lambda expression?
I am having the same issue. It seems to me that Select and SelectMany methods are not defined in the System.Linq.Dynamic assembly version you are trying to use.
Edit: It seems a lot of the extension methods are missing - Take, Skip, SingleOrDefault, FirstOrDefault etc...