Making changes to our REST API
In a previous section, we launched our REST API with the dotnet watch run
command. The watch
portion of this command instructs the dotnet
command to watch our project for changes, and autoreload the application with those changes applied. Let's see this in action!
First, we'll open our App
folder in Visual Studio Code. Once it's open, navigate to the App.WebApi\Controllers\WeatherForecastController.cs
file and find where it's generating the weather forecasts:
[HttpGet] public IEnumerable<WeatherForecast> Get() { var rng = new Random(); return Enumerable .Range(1, 5) .Select(index => new WeatherForecast { Date = DateTime.Now.AddDays(index), ...