-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
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
it
isn't interpreted as the inner parameter when using All
or Any
#440
Comments
it
isn't interperted as the inner parameter when using All
it
isn't interperted as the inner parameter when using All
or Any
Hello @zspitz , I think you are currently trying to use the library in a way that it was not built for. As said in the name, the library is made to execute LINQ query such as: var list = new List<Person>();
list.Add(new Person() {LastName = "a"});
list.Add(new Person() {LastName = "b"});
list.Add(new Person() {LastName = "c"});
var x = list.AsQueryable().Any("it.LastName == \"c\""); It's not initially intended to be a full C# evaluator. For those, there is our other library C# Eval Expression or perhaps even better for your case Roslyn Scripting. While this library tries to support as much as possible, it doesn't support everything such as LINQ method in an expression. |
The documentation suggests that the library does allow certain specific LINQ method calls, even in an expression. As part of the expression language syntax, it has this to say:
Note that this is distinct from the extension methods provided by Dynamic LINQ. Here you can see the code which parses specific |
AFAICT the primary issue is that But one way to resolve this might be to allow numbered @JonathanMagnan @StefH Any news/thoughts on this? |
it
isn't interperted as the inner parameter when using All
or Any
it
isn't interpreted as the inner parameter when using All
or Any
The following code:
fails with:
fails similarly with:
It seems as though the
it
when used in the inner lambda is still interpreted as the outerit
(in this case,Person
and notchar
).Note: I didn't test this with other LINQ methods.
This seems to run counter to the documentation:
The text was updated successfully, but these errors were encountered: