You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varapp= builder.Build();// Configure the HTTP request pipeline.if(app.Environment.IsDevelopment()){
...// Initialise and seed database
using var scope = app.Services.CreateScope();varinitializer= scope.ServiceProvider.GetRequiredService<ApplicationDbContextInitializer>();await initializer.InitializeAsync();await initializer.SeedAsync();}
Note that this won't cause issues because StartAsync quote:
StartAsync is called before:
The app's request processing pipeline is configured.
The server is started and IApplicationLifetime.ApplicationStarted is triggered.
We currently have:
Consider the following from MS guys
https://github.com/davidfowl/BlazorBlog/blob/main/MyBlog.Api/Data/MigrationHostedService.cs#L6
Note that this won't cause issues because StartAsync quote:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-8.0&tabs=visual-studio#startasync
The text was updated successfully, but these errors were encountered: