From 741e535281b7ed684c4824a08663c800405d457a Mon Sep 17 00:00:00 2001 From: Turner Bell Date: Sun, 7 Apr 2024 15:19:22 -0400 Subject: [PATCH 1/2] remove weather forecast api example --- 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 d3743d2..0000000 --- a/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace SavePointAPI.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 = DateOnly.FromDateTime(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 1a02994..0000000 --- a/WeatherForecast.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace SavePointAPI; - -public class WeatherForecast -{ - public DateOnly Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } -} From 7671ad3408532d586bedab4389e390a3f3946386 Mon Sep 17 00:00:00 2001 From: Turner Bell Date: Sun, 7 Apr 2024 15:20:03 -0400 Subject: [PATCH 2/2] add todo for database config --- Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Program.cs b/Program.cs index b7bb7e8..2db2220 100644 --- a/Program.cs +++ b/Program.cs @@ -5,6 +5,7 @@ // Add services to the container. builder.Services.AddControllers(); +// TODO: Use a database for production scenarios and configure the connection string in appsettings.json builder.Services.AddDbContext(options => options.UseInMemoryDatabase("SavePointList")); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle