Since we are building the application using a "database first" approach, let's first update the application model classes from the database. As in Chapter 3, Setting Up the Development Environment, we will use a scaffolding command, for which we will perform the following steps:
- Open the TextScoreDashboard project in Visual Studio.
- Navigate to Tools -> Nuget Package Manager -> Package Manager Console.
- Run the following command.
You will notice the -Force flag. This flag is needed to force the regeneration of the model classes from the database, replacing the existing classes we've generated previously.
The command is provided below:
Scaffold-DbContext "<database connection string>" Microsoft.EntityFrameworkCore.SqlServer ...