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

fixed precompiled query not returning a result for a different inmemo… #13503

Closed
wants to merge 2 commits into from

Conversation

JanEggers
Copy link

@JanEggers JanEggers commented Oct 4, 2018

…ry database

fixed compiled queries not returning a result when applied to different in memory database

  • locate inmemory tables by entitytype.toString() (using entitytype.Name is not sufficient because it is ambigus)
  • removed option useNameMatching as the new method works for all scenarios

fixes #13483

@dnfclas
Copy link

dnfclas commented Oct 4, 2018

CLA assistant check
All CLA requirements met.

Copy link
Member

@ajcvickers ajcvickers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that this is the correct way to fix this; it essentially changes to name matching all the time.

@JanEggers
Copy link
Author

can you please elaborate whats wrong with name matching? all tests are green?

@ajcvickers
Copy link
Member

@JanEggers It's a mechanism that allows a database to be used across multiple service providers when this is opted into. But it is not universally safe sine two entity types could have the same name but have different underlying shapes.

@JanEggers
Copy link
Author

the database is still maintened by the store in the internal serviceprovider (identified by the magic name provided when calling UseInMemoryDatabase). with the change it is just possible to find the correct tables even if the entity types are not ref equal.

can you please create a testcase that my fix may not violate. because like this it is quite hard for me to reason about what is valid and what is not

@ajcvickers
Copy link
Member

@JanEggers Sure, I'll write a test when I get a chance.

…nt in memory database

- locate inmemory tables by entitytype.toString()
- removed option useNameMatching as the new method works for all scenarios

fixes dotnet#13483
@ajcvickers
Copy link
Member

Created an issue to track the test mentioned above; closing this PR as we don't intend to merge it.

@ajcvickers ajcvickers closed this Jan 7, 2019
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.

Precompiled queries assume the model for a given DbContext will never change
3 participants