To follow the descriptions in this chapter, you will need to create an ASP.NET Core 6.0 Web API application. You can either use one of the following options:
- Option 1: Click on the New | Project command in the File menu of Visual Studio 2022 – then, choose the ASP.NET Core Web API template. Select a name and the working directory in the wizard and be sure to uncheck the Use controllers (uncheck to use minimal APIs) option in the next step.
- Option 2: Open your console, shell, or Bash terminal, and change to your working directory. Use the following command to create a new Web API application:
dotnet new webapi -minimal -o Chapter02
Now, open the project in Visual Studio by double-clicking the project file, or in Visual Studio Code, by typing the following command in the already open console:
cd Chapter02 code.
Finally, you can safely remove all the code related to the
WeatherForecast sample, as we don’t need it for this chapter...