-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Model is rebuilt when the database root changes #34476
Milestone
Comments
As the fix is quite simple (do not cache the database root as a singleton) I will already submit a PR. |
koenigst
added a commit
to koenigst/efcore
that referenced
this issue
Aug 20, 2024
…he singleton options. - Remove the DatabaseRoot from the InMemoryOptionsExtension service provider equality condition. - Remove the DatabaseRoot from the InMemorySingletonOptions. - Resolve the IInMemoryStore in a scoped service (IInMemoryStoreProvider) instead of a singleton service (IInMemoryStoreCache). - Fall back to the DatabaseRoot stored in a singleton service (IInMemoryDatabaseRootCache) if the options does not specify one. Fixes dotnet#34476
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use the
databaseRoot
parameter ofUseInMemoryDatabase
to provide test isolation when using the in-memory provider. Unfortunately setting this parameter leads to a huge performance overhead because the model is rebuilt for every test.Reproduction steps
EF Core version
Database provider:
Microsoft.EntityFrameworkCore.InMemory
8.0.8
Target framework: .NET 8.0
Operating system: Windows 11 22H2
IDE: Visual Studio 2022 (64-bit) 17.10.1
The text was updated successfully, but these errors were encountered: