-
-
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
bind expressions to correct constructor parameter #557
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please take a look at my comments
test/System.Linq.Dynamic.Core.Tests/Parser/ExpressionParserTests.TypeAccess.cs
Outdated
Show resolved
Hide resolved
Can you double check if all tests run fine? At my system, I get this test error:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you have updated the unit-tests, but actually I was expecting that you would fix the code, because the unit-test did work before, and ideally the unit-test should continue working, also with your new code.
Sop can you please take a look at the code and see if you can fix the code so that the unit-test can stay the same?
@StefH However it feels unintuitiv to bind to the field names instead of the parameters names. In the case: |
Picking them up by index works in most cases.
ex.
new(1 as a, 2 as b, 3 as c ) => {a = 1, b = 2, c = 3 }
but not if the identifiers are moved around(for example using the same type again)
new(1 as b, 2 as a, 3 as c ) => { a =1, b = 2, c = 3 }
Proposed solution.
Make sure to map the correct expression based the identifier to the same(based on type and name) constructor parameter