/// <summary> /// Seeds the specified context. /// </summary> /// <param name="context">The context.</param> private static void Seed(AdoptersContext context) { SeedSettings.Seed(context); SeedLocations.Seed(context); SeedFiles.Seed(context); SeedUsers.Seed(context); SeedReports.Seed(context); SeedNotification.Seed(context); }
/// <summary> /// Seeds the specified context. /// </summary> /// <param name="context">The context.</param> private static void Seed(HostaliandoContext context) { SeedLocations.Seed(context); SeedCurrencies.Seed(context); SeedUsers.Seed(context); SeedBookingSources.Seed(context); SeedSettings.Seed(context); SeedNotifications.Seed(context); }
public static void Main(string[] args) { var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { SeedLocations.Initialize(services); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred seeding the DB."); } } host.Run(); }