Skip to content
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

Issue with multiple entities inheriting from a base type #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iliveoncaffiene
Copy link

When 2 entity objects inherit 1 base object which contains a navigation property, the SingleOrDefault() call in NavigationFindingExpressionVisitor finds many matches.
The fix also searches the descriptor type in addition to the descriptor's member.

@tuespetre
Copy link
Owner

tuespetre commented Oct 19, 2018

Thank you! I paused to think about this for a few minutes. It seems there are three places in the code that use SingleOrDefault to find a navigation descriptor by comparing member equality. Additionally, the check should be against node.Expression.Type rather than node.Type, because Type on the navigation descriptor refers to the type exposing the navigation.

@tuespetre tuespetre closed this Oct 19, 2018
@tuespetre
Copy link
Owner

Sorry about that, slipped on the trackpad.

@tuespetre tuespetre reopened this Oct 19, 2018
@iliveoncaffiene
Copy link
Author

Glad I could help!
I had a completely different issue that I couldn't fix in order to use this with my code. The existing EF Core translator sucks performance wise when things get complicated, and I was exploring seeing if this would work on our large solution with many complex nested queries / navigations.

I'll see if I can research it more and post as an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants