Here Mudassar Khan has explained will explain with an example, how to insert data into Database using Entity Framework in ASP.Net Core Razor Pages.
When the Submit Button is clicked, the Form is submitted and the data from the fields i.e. TextBox and DropDownList is sent to Index Model where it is inserted into SQL Server Database Table using Entity Framework in ASP.Net Core Razor Pages.