-
Notifications
You must be signed in to change notification settings - Fork 5
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
Inheritance implementation for Fluent API #32
Conversation
@oformaniuk Thank you very much for this PR! I am impressed that you were able to implement the feature in just 15 lines of code. I plan to write some additional tests and aim to merge it within the next two weeks. Best regards, |
@@ -90,9 +90,9 @@ private ClassInfoResult CreateFluentApiClassInfoInternal( | |||
FluentApiAttributeInfo fluentApiAttributeInfo = | |||
FluentApiAttributeInfo.Create(attributeDataExtended.AttributeData, className); | |||
|
|||
List<FluentApiInfo> infos = new List<FluentApiInfo>(); | |||
HashSet<FluentApiInfo> infos = new HashSet<FluentApiInfo>(); |
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 think there can't be duplicates and we can stick with the list.
The implementation turned out to be more complex in cases where the base class contains private methods and private setters. In such scenarios, reflection must target the base class instead of the derived class. For example: namePropertyInfo = typeof(Person).GetProperty("Name", ... instead of namePropertyInfo = typeof(Student).GetProperty("Name", ... Best regards, |
Resolves #29
Implementation recursively checks all base types for existence of
Fluent*
attributes.