aspnet/EntityFramework — pull request #283 by ajcvickers (2014-06-02 22:59:44+00:00)
Title: Distant relatives...

Distant relatives... (Move relational-only API out of top-level Database class and into extension methods.)

From design meeting notes:
Currently the top-level runtime database creation APIs in EF7 are:
- Database.Create
- Database.CreateTables
- Database.Delete
- Database.Exists
- Database.HasTables
- Database.EnsureCreated
- Database.EnsureDeleted

The first five of these are simple operations while the Ensure... methods are composed from the simple operations. The Ensure... methods cover the common pattern for database creation in testing and rapid prototyping. They can also be reasonably implemented across multiple different types of data store.

The simple methods are not so easy to abstract in a meaningful way beyond relational databases. For example, knowing that a database exists but has no tables is useful in relational providers since it is common for an empty database to be provisioned for which EnsureCreated will detect that it is empty (HasTables returns false) and then appropriately create the tables. But for other types of store it may not be possible to check whether or not the database has tables. Therefore we will move the simple operations to be relational-only and leave only EnsureCreated and EnsureDeleted on the common surface.