O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling the database

Image

In the next chapter we’ll look at two methods for controlling the database schema that Entity Framework creates based on your class structure, but one of the most basic conventions (and one you’ll almost certainly want to use) is how, when and where the database is created. Let’s start by changing the name of the database. After all, CodeFirstDataAccess.RecipeContext is almost certainly not what you want!

You can control the name of the database by adding a connection string in the application’s configuration file (we’ll look at that in a minute), but if all you need to do is change the name of the database, the easiest ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required