nreco / lambdaparser

Runtime parser for string expressions (formulas, method calls). Builds dynamic LINQ expression tree and compiles it to lambda delegate.
http://www.nrecosite.com/
MIT License
309 stars 55 forks source link

nested expression in dictionary indexer #27

Closed lerljaku closed 4 years ago

lerljaku commented 4 years ago

this is working pretty fine: new dictionary {{0,0}, {1,1}, {3,2}} [3]

this is throwing exception: new dictionary {{0,0}, {1,1}, {3,2}} [x.Sum()]

System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ----> System.Exception : The given key was not present in the dictionary.

x is instance of class with object Sum() method, that returns 1