-
Notifications
You must be signed in to change notification settings - Fork 186
Fixed an issue where attributes of the same name cannot be expanded when subclasses inherit and hide attributes of the parent class #645
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
Changes from all commits
46929c2
7a37e50
f9f9dd9
b861460
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,7 +231,22 @@ public virtual Expression CreatePropertyValueExpression(QueryBinderContext conte | |
| PropertyInfo propertyInfo = source.Type.GetProperty(propertyName, BindingFlags.DeclaredOnly); | ||
| if (propertyInfo == null) | ||
| { | ||
| propertyInfo = source.Type.GetProperty(propertyName); | ||
| /* | ||
| History of code: | ||
| propertyInfo = source.Type.GetProperty(propertyName); | ||
| This code fixes an issue where 'History of code' was unable to obtain attributes with the same name as the parent class after the subclass hid the parent class member. | ||
| Such as: | ||
| 'History of code' cannot get the Key property of the Child. | ||
| public class Father | ||
| { | ||
| public string Key { get; set; } | ||
| } | ||
| public class Child : Father | ||
| { | ||
| public new Guid Key { get; set; } | ||
| } | ||
| */ | ||
| propertyInfo = source.Type.GetProperties().Where(m => m.Name.Equals(propertyName)).FirstOrDefault(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you please add some comments for your change in the source file?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Code comments have been added to the new submission |
||
| } | ||
|
|
||
| Expression propertyValue = Expression.Property(source, propertyInfo); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.