From 8978af10bc47999ea3842ef55756cbe802e504bf Mon Sep 17 00:00:00 2001 From: Tim Cliff Date: Wed, 10 Aug 2022 21:13:37 +0100 Subject: [PATCH] remove weather --- Controllers/WeatherForecastController.cs | 32 ------------------------ WeatherForecast.cs | 12 --------- 2 files changed, 44 deletions(-) delete mode 100644 Controllers/WeatherForecastController.cs delete mode 100644 WeatherForecast.cs diff --git a/Controllers/WeatherForecastController.cs b/Controllers/WeatherForecastController.cs deleted file mode 100644 index b5a4f42..0000000 --- a/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace Diary.Controllers; - -[ApiController] -[Route("[controller]")] -public class WeatherForecastController : ControllerBase -{ - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet(Name = "GetWeatherForecast")] - public IEnumerable Get() - { - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }) - .ToArray(); - } -} diff --git a/WeatherForecast.cs b/WeatherForecast.cs deleted file mode 100644 index f9c6df9..0000000 --- a/WeatherForecast.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Diary; - -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; } -}