Closed efronberlian closed 6 years ago
Hello @efronberlian ,
Thank you for reporting.
This problem is due because by default, the library allow to directly reference property from the entity.
By example
evalContext.Compile<Func<Entity, bool>>("entity?.TheEnum == SomeEnum", "entity");
is equivalent to
evalContext.Compile<Func<Entity, bool>>("entity?.TheEnum == entity.SomeEnum", "entity");
We will look how we can fix it today or tomorrow.
Best Regards,
Jonathan
Ahh I see. So the compiler thinks tht 'SomeEnum.A' means 'entity.SomeEnum.A' instead of referencing the enum class. That looks like a tricky problem.
Thank you so much for replying so soon. I am currently using Eval-Expressions in the project that I am working on and it's working great. Keep up the good work! :)
Yup, it was a little bit tricky to fix but I believe we did it.
The v2.4.3 has been released: https://www.nuget.org/packages/Z.Expressions.Eval/
Let me know if your scenario is now working correctly.
Best Regards,
Jonathan
It works perfectly. Thanks for the help!
I have a problem with naming enums with the same name as its type, The code below runs well as long as you don't have the variable SomeEnum. I put the comment on which line should be commented.