varbuilder=WebApplication.CreateBuilder(args);// Add services to the container.varapp=builder.Build();// Configure the HTTP request pipeline.varsummaries=new[]{"Freezing","Bracing","Chilly","Cool","Mild","Warm","Balmy","Hot","Sweltering","Scorching"};app.MapGet("/weatherforecast",()=>{varforecast=Enumerable.Range(1,5).Select(index=>newWeatherForecast(DateTime.Now.AddDays(index),Random.Shared.Next(-20,55),summaries[Random.Shared.Next(summaries.Length)])).ToArray();returnforecast;});app.Run();internalrecordWeatherForecast(DateTimeDate,intTemperatureC,string?Summary){publicintTemperatureF=>32+(int)(TemperatureC/0.5556);}