Closed OlegNadymov closed 11 months ago
@OlegNadymov Can you provide the full "User" class?
@OlegNadymov I could not test it 100% (due to missing User class), but I've updated the code.
Can you try 1.3.8-preview-02
?
you probably need 1.3.8-preview-03
Unfortunately, again ParseException: ')' or ',' expected
.
I see that now inner statements have the same number of quoutes (two):
{Param_0 => In(Param_0.Id, SubSelect("Identity", "LegalPerson", Concat(Concat("StaticHelper.In(ParentId, StaticHelper.SubSelect(""LegalPersonId"", ""PointSiteTD"", ""Identity = ", ToExpressionString(Get("CurrentPlace"), 2)), """, """"))"), ""))}
But in the old version they had one single quote:
{Param_0 => In(Param_0.Id, SubSelect("Identity", "LegalPerson", Concat(Concat("StaticHelper.In(ParentId, StaticHelper.SubSelect("LegalPersonId", "PointSiteTD", "Identity = ", ToExpressionString(Get("CurrentPlace"), 2)), "", ""))"), ""))}
So, when I try to DynamicInvoke the complied expression I have the exception here:
BTW, I use the same User class from your tests, but I've added new three properties as you did here: https://github.com/zzzprojects/System.Linq.Dynamic.Core/pull/760
Can you try preview-4?
It seems to be working now 👍
Thanks for verifying. Please do some more tests, and if it's working good, close this issue.
Ok! I'm trying to check if it works for a deeper level. I think, I don't have expressions with deeper levels. But I'm wondering if it works.
All my tests are passed successfully. So, I will be looking forward for release these features to upgrade your package on my production.
@OlegNadymov I'll merge this PR to master.
I've no date yet on a new release. I'll keep you informed.
@StefH thanks for the information! 👍
1. Description
In continuation of https://github.com/zzzprojects/System.Linq.Dynamic.Core/issues/757
I have more complex string expressions with inner methods with inner string statements, e.g.:
The classes:
The above expression can be parsed on the preview version. But not invoked. I have ParseException during invoke. I've found differencies how the old and the new version parse this expression:
The old version:
The new version:
Here starting with PointSiteTD statements there are two quotes in the new version instead single in the old version. So, when I try to parse with expression inside
StaticHelper.SubSelect
to buildSqlExpression.Filter
I have the mentioned exception.2. Exception
Exception message:
3. Fiddle or Project
Again, I have done changes in DynamicExpressionParserTests only locally.
4. Any further technical details
It is working on v.1.0.8.18. But it is not working on even version 1.3.8-preview-01.