Client Hub Project
This commit is contained in:
19
ClientHub/Data/WeatherForecastService.cs
Normal file
19
ClientHub/Data/WeatherForecastService.cs
Normal file
@ -0,0 +1,19 @@
|
||||
namespace OI.Metrology.ClientHub.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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user