make service singleton

This commit is contained in:
Ryan Peters 2023-03-18 15:35:15 +00:00
parent 3398dd3695
commit 47d34eb4d1

View File

@ -5,7 +5,7 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddHttpClient();
builder.Services.AddTransient<IForecastService, WeatherApiForecastService>();
builder.Services.AddSingleton<IForecastService, WeatherApiForecastService>();
var app = builder.Build();