Add pizza page to the app

Add a Pizza list page with a form

Change directory to RazorPagesPizza project directory if required and run the following .NET CLI command in the terminal:

dotnet new page --name Pizza --namespace RazorPagesPizza.Pages --output Pages

The preceding command:

  • Creates the following files in the RazorPagesPizza.Pages namespace:

    • Pizza.cshtml—The Razor page

    • Pizza.cshtml.cs—The accompanying PageModel class

  • Stores both files in the project's Pages directory.

Note that there's nothing magical about using the CLI to create these files!

You can also create the files manually; the CLI command is just a shortcut for doing so.

Last updated