Learning ASP.Net Core from Scratch - Chapter 2

Chapter 2 

1. Add InMemory Database services in Startup.cs,

Need "using Microsoft.EntityFrameworkCore;



2. Create a AppDbContext.cs Class



3. Create a Customer.cs class with properties Id and Name


4. Add a Razor page in "Pages" folder 


Use the Plain Razor page

Give the name of the page as "Create" and click Add.

5. Write the following in Create.cstml.cs 




BindProperty is used to bind the values to the cshtml.

6. Write the following code for Create.cshtml

7. This will create a simple form that takes the name


Comments