Skip to Content
Learn
Data Edits
EF Diagram

The EF diagram now shows how data is saved from the browser to the database:

  • The user makes changes to existing data or adds new data
  • The data is sent to the Razor page with a POST method that usually is triggered by a button click
  • The Razor page parses the data fields from the <form> POST and assigns it to a member variable
  • The variable is merged into the EF context DBSet using Add() for a new record, Attach() for an update, and Remove() for a deletion
  • Each of these three context methods generate the SQL statements necessary to complete the task
  • The SQL is sent to the database so the data can persist
Folder Icon

Sign up to start coding

Already have an account?