make service singleton
This commit is contained in:
parent
3398dd3695
commit
47d34eb4d1
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user