© Eric Vogel 2021
E. VogelBeginning Entity Framework Core 5https://doi.org/10.1007/978-1-4842-6882-7_5

5. Creating a Database from Code

Eric Vogel1  
(1)
Okemos, MI, USA
 

So far we have created our entities and their metadata to instruct Entity Framework Core 5 what to create. As you will soon see, the process of taking those instructions and having them be interpreted by Entity Framework Core 5 to create your database is as simple as creating an initial migration and running that migration using Visual Studio. We will primarily be using the Microsoft SQL Server provider for Entity Framework Core in this book and thus will be creating a SQL Server database.

Setting the Connection String

The first step in creating a database from code in Entity Framework ...

Get Beginning Entity Framework Core 5: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.