-
Notifications
You must be signed in to change notification settings - Fork 12
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 doesn't go deep enough #29
Comments
Thanks for the bug report. I'm not sure what further information you would expect to see. Could you clarify, using the first tree you provided with additional details you would like to see? Is it because the Alternatively, if the expression is being generated within the As far as the depth of the expression tree, I don't see anything in the expression tree you provided:
that isn't in the resultant string. (NB. It seems almost too trivial to mention, but the parts of an expression tree are often not in the same order as the code representation. For example, using the string representation you provided, the various code parts of the expression tree would be distributed like this:
Note also that |
Hi @zspitz , Yes, so it's more that I would expect to see the tree with the actual values that are being tucked away deeper in the object graph. So basically, when I pass in
I would expect to see somewhere in the tree a line that showed what the actual value produced by the right side value(). i.e.
when object.function().property.value() => "123456" As for the order, I am only concerned in the data returned, insomuch that it gives me the actual values assigned to the various nodes of the tree, like it does with you use a simple expression with no object.function(). |
@VagyokC4 OK, I see now; thanks. This looks like a good idea, and I will try to implement it. Is this what you had in mind?
Note that we can't provide values for any expression tree containing a parameter expression, which doesn't have an associated value embedded in the expression tree. In this case, the entire left side of the |
@zspitz Exactly Right! How soon before we could see this functionality? |
@VagyokC4 This is what needs to be resolved / done. Perhaps by the end of the week, although I can't fully commit to that. Questions:
Parts of the implementation:
|
@zspitz How is this progressing? |
@VagyokC4 Could I have your input on something? The following expression:
represents a never-ending empty loop:
Ordinarily, loop expressions have a value -- the value of the last executed expression within the loop block -- but a never-ending loop cannot be evaluated. Wrapping the loop expression in a AFAICT there's no way to tell from looking at a What do you think? |
@VagyokC4 I've committed the changes, but there are a few failing tests because I never anticipated the test expressions would actually be evaluated. It should be available by tomorrow. |
As of NuGet package version 2.0.25, this should be working. |
Sorry I just saw this. So what was the fix for this empty loop scenario? How often does one get an empty loop? I assume this is edge case? BTW: 2.0.25 is looking good. Thank-you for all your hard work! |
No fix, as such; as I said, there's no attempt to provide a value for the
I realized later that the issue is not so much the empty loop, but the never-ending loop, which is probably more common. Although I haven't seen much use in general of the statement-style expression trees (loops, goto, if...else etc.) added in .NET 4. But even if it is an edge case, the workaround is simple, if a little ham-handed. |
Describe the bug
This library works good with simple expression trees. But for expression trees that run deep, it simply stops returning values, and reverts to displaying non specific information.
To Reproduce
Any multi-step expression that has multiple layers of functions e.g.
f => f.EmailAddress.ToLower() == Request.UserSession().Email.ToLower())
which produces the following tree
Expected behavior
I would expect this library to run recursively and capture all levels of the expression tree, not just the top levels, but most importantly, it will display the actual values being used for the query as it does with this simple expression:
Version info
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: