Create a project
Create a web API project
Follow the instructions below:
Open your File Explorer
Create a new folder named ContosoPizza in the location of your choice, and then open a terminal on that folder
Use change directory command if required
In the terminal window, copy and paste the following command:
This command creates the files for a basic web API project that uses controllers, along with a C# project file named ContosoPizza.csproj that will return a list of weather forecasts.
The command uses an ASP.NET Core project template, aliased as webapi, to scaffold a C#-based web API project. A ContosoPizza directory is created. This directory contains an ASP.NET Core project running on .NET. The project name matches the ContosoPizza directory name.
You should now have access to these files:
Examine the following files and directories:
NameDescriptionControllers/
Contains classes with public methods exposed as HTTP endpoints
Program.cs
Configures services and the app's HTTP request pipeline, and contains the app's managed entry point
ContosoPizza.csproj
Contains configuration metadata for the project
Last updated