Comments (2)
"Count" is a property of IList interface; there are no "Max" or "Min" properties there.
In C# code you can use values.Max()
or values.Min()
- but this is extension methods (in fact, static methods defined in System.Linq). Static methods cannot be used in LambdaParser.
If you need to calculate Min or Max you can provide these functions into the evaluation context:
varContext["myValues"] = new [] { 1, 5, 10 };
varContext["Min"] = (Func<IList,object>)((values) => {
// here is your code that returns 'max' value for generic IList input
});
Console.WriteLine(lambdaParser.Eval("Max(myValues)", varContext));
from lambdaparser.
"Count" is a property of IList interface; there are no "Max" or "Min" properties there.
In C# code you can use
values.Max()
orvalues.Min()
- but this is extension methods (in fact, static methods defined in System.Linq). Static methods cannot be used in LambdaParser.If you need to calculate Min or Max you can provide these functions into the evaluation context:
varContext["myValues"] = new [] { 1, 5, 10 }; varContext["Min"] = (Func<IList,object>)((values) => { // here is your code that returns 'max' value for generic IList input }); Console.WriteLine(lambdaParser.Eval("Max(myValues)", varContext));
Thanks~!
from lambdaparser.
Related Issues (20)
- LambdaParser.Parse HOT 1
- SL5 MacOs support HOT 3
- nested expression in dictionary indexer
- Security? HOT 7
- Allow recursivity HOT 5
- Math Operations like power (exponentiate) and to extract a root -possible? HOT 2
- Error - Filter Datatable with LINQ inside the .Eval function HOT 4
- Lambda Sum or Select HOT 1
- Changing order of parameters in simple expression produces different evaluation result. HOT 5
- Expressions using "not" not always work HOT 4
- Support for dynamic types like expando object
- Parser Context Security HOT 1
- "Expected value" error in simple expression HOT 2
- Non-convertible types support
- Variables in expressions HOT 1
- Sequence of ternary operators HOT 1
- How to throw exception? HOT 1
- it is not support Convert HOT 1
- The problem of checking expression statements HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lambdaparser.