-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Dynamic map of base class influences child class map #3025
Comments
I've already answered this on SO. |
Sry, but no, you did not. "
BR Matthias |
Dynamic mapping only works in the very simple cases, isolated maps etc. Because you start to run into the order in which maps are used that affect mapping plans, I generally don't advise doing what you described above. I'm not too interested in documenting edge cases of dynamic mapping, and would rather just describe the scenarios in which you should use it - small, simple applications. Past that is 🤷♂️ |
Is this one of the rare occasions of "it's a feature not a bug" or why do we not agree that this is a bug? Why does dynamic map not create a map for the type just because a base-type map already exists? |
No I think it's neither a feature nor a bug - it just is. Honestly it's issues like this that lead me to want to get rid of this feature altogether. There's never going to be a good way to document behavior, or provide "right" behavior since so much depends on the order in which things happen, and our up-front configuration is designed to resolve all these scenarios. JIT mapping will never, and I don't ever expect it to. |
I totally agree. It's too much magic. I was thinking that you could reduce the magic and "state" by not looking for base-class maps and always create a clean map for the concrete type at hand, but I can see now that you don't want to pick up on this idea. ^^ edit: I do not agree that odd behavior should not be documented so I created a small blog post for anybody running into similar problems. |
I don't see a way to address this behavior without breaking other scenarios. If you have a PR that doesn't break a bunch of other tests, we can take a look. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
we stumbled across some odd behavior with dynamic maps.
foo.VersionNumber
will benull
when I call a dynamic map on the base class before and set to123
when I don't. That's strange to me.When I try the same with types and not concrete objects it throws an exception. I guess because the dynamically generated map for the base class
Bar
can not be used forFoo
. But the exception message is strange.We already learned that we will not use dynamic maps anymore. Just wanted to share our findings and ask if this behavior is intentional or a unknown side effect.
Thanks and BR Matthias
The text was updated successfully, but these errors were encountered: