Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: MustFix: Code First Logic to create tables on empty database should work with other providers [371]

$
0
0
In EF5 we made Code First work in scenarios in which the target database exists but the tables still need to be created. This functionality depends on a check that is implemented in the method DatabaseTableChecker.AnyModelTableExists which currently executes hardcoded SQL information schema queries for "System.Data.SqlClient" and "System.Data.SqlClientCe.4.0" but returns true for any other ADO.NET provider invariant names:

switch (providerName)
{
case "System.Data.SqlClient":
provider = new SqlPseudoProvider();
break;
case "System.Data.SqlServerCe.4.0":
provider = new SqlCePseudoProvider();
break;
default:
return true;
}

We should instead make this logic work with any provider either moving the capabilities of the pseudo provider into the actual provider model or by taking advantage of existing functionality of the Migrations Initializer or of schema discovery in the existing provider model.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>