Skip to content

Commit

Permalink
Initialize dummy database.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcanosantana committed Nov 26, 2023
1 parent 15898fe commit ceee0a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddSingleton<UserService>();

//This Singleton is not static, it's an instance that will be injected across pages
var userService = new UserService();
userService.InitializeDummyDB();
builder.Services.AddSingleton<UserService>(userService);

await builder.Build().RunAsync();

0 comments on commit ceee0a4

Please sign in to comment.