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

18. Updating Data on the Web

Eric Vogel1  
(1)
Okemos, MI, USA
 

In this chapter, I will cover how to update data using Entity Framework Core 5 and Razor Pages in ASP.NET Core. First, I will go over the generated Edit Razor Page and model that were previously created. After that, I will cover how to update the Edit Razor Page to edit an address record for our edited person.

Generated Edit Razor Page View

The Edit Razor Page view is in the Edit.cshtml file under Pages ➤ Contacts and should look like Listing 18-1.
@page
@model EFCore5WebApp.Pages.Contacts.EditModel
@{
    ViewData["Title"] = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h1>Edit</h1> ...

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.