-
Notifications
You must be signed in to change notification settings - Fork 934
Allow setting dynamic component templates from dictionary in ByCode #1941
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
Allow setting dynamic component templates from dictionary in ByCode #1941
Conversation
src/NHibernate.Test/MappingByCode/ExplicitMappingTests/DynamicComponentMappingTests.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Feel free to try your suggestions directly here if you wish. I have less time available currently for contributing, and I am not prioritizing this PR over other PRs. I will probably not look into the trouble raised by Alexander before next week-end. |
Ok I've checked the code and my suggestions are not really helpful. I don't know how to make this delegate work without huge refactoring |
src/NHibernate/Mapping/ByCode/Impl/CustomizersImpl/PropertyContainerCustomizer.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
#pragma warning restore 618 | ||
} | ||
|
||
[Obsolete("Please use GetRequiredPropertyOrFieldByName instead.")] | ||
public static MemberInfo GetPropertyOrFieldMatchingNameOrThrow(string memberName) |
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.
Having this method static really sucks.
src/NHibernate.Test/MappingByCode/ExplicitMappingTests/DynamicComponentMappingTests.cs
Outdated
Show resolved
Hide resolved
src/NHibernate/Mapping/ByCode/Impl/CustomizersImpl/PropertyContainerCustomizer.cs
Outdated
Show resolved
Hide resolved
4e02aa9
to
492c29a
Compare
Fixes nhibernate#913 - NH-3704 Co-authored-by: Alexander Zaytsev <hazzik@gmail.com> Co-authored-by: Frédéric Delaporte <12201973+fredericdelaporte@users.noreply.github.com>
492c29a
to
cc2ed3b
Compare
Rebased and squashed, for allowing merging while keeping its original author. |
Fixes #913 - NH-3704
Replaces #341. It is a rebase of it, with fixes required due to changes in NHibernate.
The original PR repository being deleted, I do not see any way to work with it other than opening a new PR.
The original PR was put in the 6.0 milestone, but it does not have breaking changes. It can be put in the 5.3 milestone.
There was a discussion about the implementation relying on dynamically building a type matching the component. It allows to re-use the existing By-Code logic working on anonymous types, rather than coding a whole new code path for mapping dynamic components by code. It is a bit runtime heavy way of doing things, but it seems doing it another way will require a bit to much changes in By-Code.
If approved, it should be manually squashed before merging, in order to keep Ricardo as the main author.