forked from dotnet/ef6
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Heisenberg existence... (Allow model store item collection to be used…
… in provider DbDatabaseExists method in cases where it was previously available.) We changed code in 6.1.1 to avoid the need to build the model before calling Exists. The reason for this is that building the model can require a connection to the database in order to get the provider manifest token. This means that, the model passed to Exists was empty because the real model has not yet been built. Note that this could happen in certain code paths before (e.g. always with Migrations and when using static methods on Database), but it now happens in most or all code paths. The problem with this is that some providers use the model information in order to return something useable from Exists when it is not possible to know if the "database" has been created or not. The fix included here adds a new method to DbProviderServices that takes a Lazy<StoreItemCollection>. The SQL Server provider overrides this method but never evaluates the Lazy and so the model is still not built. Providers that do not override the new method will get the base implementation which simply evaluates the Lazy and calls the original DbDatabaseExists method. This should therefore revert to the 6.1 behavior for providers other than SQL Server.
- Loading branch information
1 parent
9dd0827
commit 787e6ab
Showing
12 changed files
with
168 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.