In my project I'd like to get all configuration information locally when the project starts. I created a ConfigurationManager service with HttpClient injected into it. On Blazor components there are lifecycle events such as OnInitializedAsync that get called when the component is created.
protected override async Task OnInitializedAsync()
{
await ...
}
Is there something equivalent for services?
Program.cs contains the following
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped<StateManager>();
await builder.Build().RunAsync();
}