In this chapter, I will go over how to insert data in our database using Entity Framework Core 5 and ASP.NET Core Razor Pages. I will cover the generated Create Razor Page from the previous chapter. I will also show how to allow adding an address record.
Generated Create Razor Page
Visual Studio generated the Create.cshtml and Create.cshtml.cs files, which are the view and model, respectively. Let’s now take a look at the generated Create Razor view and model classes. These files allow the user to create a new person record.