From 1a760a881f95ad49abdfdf6cc6d59bc6f381ab7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Tue, 1 Dec 2020 20:18:09 +0100 Subject: [PATCH] SES-64 code cleanup --- .../Controllers/WeatherForecastController.cs | 39 ------------------- .../SessionCompanion/SessionCompanion.csproj | 4 ++ .../SessionCompanion/WeatherForecast.cs | 15 ------- 3 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 SessionCompanion/SessionCompanion/Controllers/WeatherForecastController.cs delete mode 100644 SessionCompanion/SessionCompanion/WeatherForecast.cs diff --git a/SessionCompanion/SessionCompanion/Controllers/WeatherForecastController.cs b/SessionCompanion/SessionCompanion/Controllers/WeatherForecastController.cs deleted file mode 100644 index 7db9901..0000000 --- a/SessionCompanion/SessionCompanion/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace SessionCompanion.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] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} diff --git a/SessionCompanion/SessionCompanion/SessionCompanion.csproj b/SessionCompanion/SessionCompanion/SessionCompanion.csproj index 4da3811..83b3adc 100644 --- a/SessionCompanion/SessionCompanion/SessionCompanion.csproj +++ b/SessionCompanion/SessionCompanion/SessionCompanion.csproj @@ -23,6 +23,10 @@ + + + + diff --git a/SessionCompanion/SessionCompanion/WeatherForecast.cs b/SessionCompanion/SessionCompanion/WeatherForecast.cs deleted file mode 100644 index db94121..0000000 --- a/SessionCompanion/SessionCompanion/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace SessionCompanion -{ - 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; } - } -}