-
-
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
DynamicExpression parser can't parse when there is a dot in a string #683
Comments
Hello @YeskaNova, In your example code, the string value in the expression, To work around this: 1] 2] var expression = DynamicExpressionParser.ParseLambda(typeof(EntityDbo), typeof(bool), "Name == @0", "System.Int32"); |
Why it tries to interpret something within the string quotes ? isn't that a security issue ? |
You mean : "Name=\"System.Int32\"" ? |
Yes, this part "System.Int32" is a string token and should not be interpreted by the interpretor. |
What do you mean by string token? The whole purpose from this library is to allow dynamic querying using a string expression, like: var resultDynamic = context.Customers
.Where("City == \"Paris\"")
.ToList(); |
The string token is "System.Int32" . For example, this code should work:
"Paris" is a string token, and the interpretor should not try to understand what is "inside" the string. Like "1/0" should not be a problem but 1/0 will raise an exception, anything inside a string should not be considered by the interpretor. I don't see any usecase where intepreting inside a string is useful ( and that's not string interpolation ) |
It will be fixed in next release. |
Great, thanks a lot! |
1. Description
I need to parse a condition that checks that the Name of an entity is "System.Int32" , but because of the dot, I get an error. Could you see why is that happening please? It seems to me that it's a very simple situation.
2. Exception
Unhandled exception. '.' or '(' or string literal expected (at index 19)
3. Fiddle
https://dotnetfiddle.net/hdL13r
The text was updated successfully, but these errors were encountered: