MudBlazorUI/Startup.cs
/// <summary>
/// Executes database seeder just after all application services has started.
/// </summary>
/// <param name="serviceProvider"></param>
Executes database seeder just after all application services has started.
Executes database seeder just after all application services has started .
public void SeedDb(IServiceProvider serviceProvider)
        {
            using var scope = serviceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope();
            using var context = scope.ServiceProvider.GetRequiredService<UserDbContext>();
            DbInitializer<UserDbContext>.Initialize(context, seedSize);
        }
public void SeedDb ( IServiceProvider serviceProvider ) { using var scope = serviceProvider . GetRequiredService < IServiceScopeFactory > ( ) . CreateScope ( ) ; using var context = scope . ServiceProvider . GetRequiredService < UserDbContext > ( ) ; DbInitializer < UserDbContext > . Initialize ( context , seedSize ) ; }
Executes database seeder just after all application services has started.
Executes database seeder just after all application services has started .
serviceProvider
IServiceProvider
None