Choosing the Database Engine

Before doing that, though, we need to choose which Database engine we would like to use. We’ll take this as an opportunity to demonstrate the versatility of the Code-First approach.

From the main Menu, select View | SQL Server Object Explorer and look through the available development-ready Databases; you should have at least one MSSQLocalDB Database instance under the SQL Server node:

If you have one or more instances of SQL Server and/or SQL Express installed, you will also find a reference for each one of them.

If you have no entries (no SQL Server node), you are most likely missing the SQL Server Data Tools component from your Visual Studio installation; in order to fix that, you need to open the Visual Studio Installer and add the SQL Server Data Tools components. Once you’re done, restart Visual Studio; the default MSSQLLocalDB instance should be ready and available.

For now, we'll use the (localdb)MSSQLLocalDB instance; we need to keep track of that name, as we’ll need to use it in the appsettings.json file in a short while.

The default (localdb)MSSQLLocalDB instance we have just choosen might be viable enough for development, but it won’t work on production. Don’t worry, though, we will choose a whole different Database engine when we get to the deployment phase. As we said before, we’re doing that on purpose in order to demonstrate the versatility of the Code-First approach.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.37.20