Open BossJake opened 3 years ago
NReco.LambdaParser is about simple expressions (math operations, method calls, accessing properties/fields). It doesn't support delegates definition that "Sum" expects.
Also, "Sum" is an extension method for IEnumerable -- in other words, this is a static method -- and LambdaParser doesn't support static method calls. This is by design; usually expressions are composed by the app end-users and should be evaluated in a 'safe' way, and everything that can be used in the expression (variables, methods) should be passed with a context.
I'm not sure that this capability (delegates definition) can be added easily. In my projects where I use LambdaParser delegates are not needed, so if you need them you may develop this functionality by yourself. We can discuss the details if you want to contribute this with PR.
Hey guys, I'm trying to perform the expression below like Sum(x=>x.UnitQuantity) or Select(x=>x...) but I'm unable to parse it properly and I am getting this exception error below. Am I missing something with my expression?
`
`