Learning database-first development
In this section, we will build a .NET Core console application to explore the database-first approach and see how entity models are created from an existing database (reverse engineering).
Creating a .NET Core console app
To create a new .NET Core console app, follow these steps:
- Open Visual Studio 2019 and select Create a new project.
- Select the Console App (.NET Core) project template.
- Click Next. On the next screen, name the project
EFCore_DatabaseFirst
. - Click Create to let Visual Studio generate the default files for you.
Now, we are going to add the required Entity Framework Core packages in our application for us to work with our existing database using the database-first approach.
Integrating Entity Framework Core
The Entity Framework Core feature was implemented as a separate NuGet package to allow developers to easily integrate features that the application needs.
As you may have already learned...