-
Notifications
You must be signed in to change notification settings - Fork 934
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
Fix fetching properties from unmapped base class #3357
Conversation
resultOperator.RelationMember.ReflectedType.FullName).FirstOrDefault(); | ||
if (!string.IsNullOrEmpty(entityName)) | ||
foreach (var entityName in queryModelVisitor.VisitorParameters.SessionFactory | ||
.GetImplementors(resultOperator.RelationMember.ReflectedType.FullName)) |
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.
The main problem with resultOperator.RelationMember.ReflectedType
that we don't know the actual entity type. Only declaring type of fetched property (which is not equal to entity type if this property is from some base class). That's why we need to check all implementors.
Ideally, we should retrieve entity from query source (my plan for 5.5)
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.
The main problem here that we don't know the actual entity type.
Actually we do. It is in query source as you've said.
Btw, |
Fixes #3352
Annoyingly, it’s caused by my non-regression fix #3320. On the bright side, it uncovered a few flaws in the current Fetch implementation which I plan to fix in 5.5
Apart from regression it fixes broken in 5.3 fetching lazy properties from base unmapped class.