Add a Database and Scaffold Pages in Visual Studio

Using Visual Studio on your own computer, connect your ASP.NET application to a database and generate pages for CRUD operations

In this video, you’ll learn how to add a model, database, and scaffolded pages to an existing ASP.NET Razor Pages application on your own computer. If you don’t already have Visual Studio, follow this set-up article.

Here’s a quick recap of the skills covered:

  • Add database model with data annotations
  • Generate scaffolded pages for CRUD operations using Visual Studio
  • Run database migrations with the Package Manager Console (Windows) or dotnet CLI (Mac)
  • Initialize a database with the Package Manager Console (Windows) or dotnet CLI (Mac)

When you feel comfortable with these, you’re ready to move on!

If you’d like to read more about the features in this video, take a look at these articles: