From f87cab12b50b0524c05678e512e67931637912fc Mon Sep 17 00:00:00 2001 From: Hassan Aliakbari Date: Thu, 22 Feb 2024 02:24:53 -0500 Subject: [PATCH] - --- Examples/WebApp/Program.cs | 6 ++++++ Examples/WebApp/WeatherForecast.cs | 13 ------------- 2 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 Examples/WebApp/WeatherForecast.cs diff --git a/Examples/WebApp/Program.cs b/Examples/WebApp/Program.cs index a947014..96cad31 100644 --- a/Examples/WebApp/Program.cs +++ b/Examples/WebApp/Program.cs @@ -1,3 +1,5 @@ +using WebApp; + var builder = WebApplication.CreateBuilder(args); // Add services to the container. @@ -7,6 +9,10 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); + +builder.Services.AddHostedService(); +builder.Services.AddSingleton(); + var app = builder.Build(); // Configure the HTTP request pipeline. diff --git a/Examples/WebApp/WeatherForecast.cs b/Examples/WebApp/WeatherForecast.cs deleted file mode 100644 index 85e372d..0000000 --- a/Examples/WebApp/WeatherForecast.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace WebApp -{ - 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; } - } -}