Files
Data-Coupler/Data_Coupler/Data/WeatherForecastService.cs
T
Alessio Dal Santo f965550fd6 -Creato progetto base
-Modificato framework .NET da 7 a 9
2025-03-10 17:39:56 +01:00

20 lines
624 B
C#

namespace Data_Coupler.Data;
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate)
{
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
}).ToArray());
}
}