From 79eb24c1dc61341f421e589bc9bc9c9b5349c8d7 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 May 2021 19:32:05 +0200 Subject: [PATCH] Eliminazione oggetti weather forecast in Data --- MP.Stats/Data/WeatherForecast.cs | 15 --------------- MP.Stats/Data/WeatherForecastService.cs | 25 ------------------------- 2 files changed, 40 deletions(-) delete mode 100644 MP.Stats/Data/WeatherForecast.cs delete mode 100644 MP.Stats/Data/WeatherForecastService.cs diff --git a/MP.Stats/Data/WeatherForecast.cs b/MP.Stats/Data/WeatherForecast.cs deleted file mode 100644 index b5ff87aa..00000000 --- a/MP.Stats/Data/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace MP.Stats.Data -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string Summary { get; set; } - } -} diff --git a/MP.Stats/Data/WeatherForecastService.cs b/MP.Stats/Data/WeatherForecastService.cs deleted file mode 100644 index 02f62be9..00000000 --- a/MP.Stats/Data/WeatherForecastService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - -namespace MP.Stats.Data -{ - public class WeatherForecastService - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - public Task GetForecastAsync(DateTime startDate) - { - var rng = new Random(); - return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = startDate.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }).ToArray()); - } - } -}