Boolean operators not working for dynamic objects
See original GitHub issueHello,
I’ve encountered this issue when trying to use boolean operators with dynamic properties:
dynamic dyn = new ExpandoObject();
dyn.val1 = 100;
dyn.val2 = 200;
var interpreter = new Interpreter();
interpreter.SetVariable("dyn", dyn);
interpreter.Eval("dyn.val1 == 100"); //returns true, as expected
interpreter.Eval("dyn.val1 == 100 && dyn.val2 == 200"); // throws exception: "Invalid argument value\r\nParameter name: operation
Please advise if this is indeed a bug or something is not properly configured.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Filter a list of objects with dynamic boolean operators
Up to now it does it job: based on a static List of objects, it returns what can be filtered from the list...
Read more >Working with untyped and dynamic objects - Power Apps
When dealing with actions in Power Apps, it's possible to encounter untyped return values or input values for some actions.
Read more >How to dynamically assign properties to an object in ...
Understanding the problem with dynamically assigning properties to objects. Generally speaking, TypeScript determines the type of a variable ...
Read more >Boolean operators allow conditional search results
Note: Boolean operators are case-sensitive. For example, OR is a Boolean operator while Or and or are search terms that may be stop...
Read more >Edit objects using Boolean operations
Combine objects using Boolean operations. You can combine simple shapes to create compound shapes and objects. Select the shapes that you ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I made my very first PR 😃
In
which is called when there are dynamic expressions, expression type AndAlso is passed, problem is that Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation does not seem to support this type of operation. Changing it to And seems to resolve the issue, also added a small test to check that Andi’s scenario works and it does, and all other tests run successfully.
Cound not push my branch to the repo (I may need rights), but the fix should be reasonably simple that there is no need to get my on the PR pipeline.