-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add ObjectHelper support for property resolution for nullable value types #18970
Conversation
case ExpressionType.Convert: { | ||
memberExpression = propertySelector.Body.As<UnaryExpression>().Operand as MemberExpression; | ||
break; | ||
} |
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.
Can you share some test code to cover this case?
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've integrated the test to cover the explicit case.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #18970 +/- ##
==========================================
- Coverage 51.68% 51.68% -0.01%
==========================================
Files 3092 3092
Lines 98045 98080 +35
Branches 7819 7820 +1
==========================================
+ Hits 50671 50689 +18
- Misses 45823 45838 +15
- Partials 1551 1553 +2 ☔ View full report in Codecov by Sentry. |
Thanks @namtab00 |
Description
I'm using an overriding AuditPropertySetter, that sets a
long CreatorId
(defined on new entity interfaces, not IMust/MayHaveCreator).With this setup, ObjectHelper.TrySetProperty did not set that property, due to the member selector expression pointing to a value type.
This PR adds retro-compatible support for such an expression, with no breaking changes.
Checklist
How to test it?
Created specific unit test.