-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Bug when using DatabaseContext in Computed method #152
Comments
Could you please provide a full sample to check this further? |
Hi @hazzik, @magicmoux , We've just ran into the same issue, and I've added a failing test for it. Could you please have a look at my branch? Br, Zoltán |
Hi @cervengoc , As I suspected the problem is that DD currently handles System.Linq.Expressions.Expression.xxx methods verbatim, which finally confuses the ELinq translator. At the time I proposed #151 to handle these calls. |
Possible fix hazzik#122 Feature prop to enable closure for local IQueryable
This should be fixed by #192 |
I have a method like this:
Ignore the logic, its only for testing :) But when it is compiled query looks like this:
And this is query without delegate decompiler:
See how 's' is without '[]' in DD query, which leads to optimized query looks like:
And I get error:
variable 's' of type 'ShiftPeriod' referenced from scope '', but it is not defined
So I assume there is bug when DatabseContext is used inside a computed method :) Or maybe DD is not supposed to work like that and I should not use DatabseContext inside computed method?
The text was updated successfully, but these errors were encountered: