We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I am trying to execute following kind of expression
evaluator.Evaluate("Enumerable.Range(0, 10).Select(x => x * x)");
but I get following error for it:
CodingSeb.ExpressionEvaluator.ExpressionEvaluatorSyntaxErrorException: '[System.Linq.Enumerable+d__113] object has no Method named "Select".'
Interesting part is that this works in LINQPad (.NET Core 3.1.8) but not within Visual Studio (.NET Framework 4.7.2).
If I run following code in VS:
var result_a = Enumerable.Range(0, 10); var result_b = evaluator.Evaluate("Enumerable.Range(0, 10)");
I can see that both variables have value System.Linq.Enumerable.<RangeIterator>d__113} but different types:
System.Linq.Enumerable.<RangeIterator>d__113}
result_a: System.Collections.Generic.IEnumerable<int> {System.Linq.Enumerable.<RangeIterator>d__113} result_b: object {System.Linq.Enumerable.<RangeIterator>d__113}
I don't get what is going on here and why it works in LINQPad but not in VS. Any hints?
The text was updated successfully, but these errors were encountered:
Found the trick: you have to use Cast(). So
evaluator.Evaluate("Enumerable.Range(0, 10).Cast().Select(x => x * x)");
works nicely. Case closed.
Sorry, something went wrong.
No branches or pull requests
Hi,
I am trying to execute following kind of expression
evaluator.Evaluate("Enumerable.Range(0, 10).Select(x => x * x)");
but I get following error for it:
CodingSeb.ExpressionEvaluator.ExpressionEvaluatorSyntaxErrorException: '[System.Linq.Enumerable+d__113] object has no Method named "Select".'
Interesting part is that this works in LINQPad (.NET Core 3.1.8) but not within Visual Studio (.NET Framework 4.7.2).
If I run following code in VS:
I can see that both variables have value
System.Linq.Enumerable.<RangeIterator>d__113}
but different types:
I don't get what is going on here and why it works in LINQPad but not in VS. Any hints?
The text was updated successfully, but these errors were encountered: