public static void Main(string[] args) { var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var context = services.GetRequiredService<DataContext>(); context.Database.Migrate(); SeedCategories.Seed(context); Seed.SeedUsers(context); } catch(Exception ex) { var logger = services.GetRequiredService<ILogger<Program>>(); logger.LogError(ex, "An error occured during migration"); } } host.Run(); }
public Seedling(string filename, string parentCategory, string childCategory) { FileName = filename; CategoryId = SeedCategories.GetCategoryId(parentCategory, childCategory); }
public Seedling(string filename, string category) { FileName = filename; CategoryId = SeedCategories.GetCategoryId(category); }
public BLUCarnivaleSeedling(string name, string category) { FileName = name; CategoryId = SeedCategories.GetCategoryId(category); }
public BLUSpellSeedling(string name, string category) { FileName = name; CategoryId = SeedCategories.GetCategoryId(category); }
public CraftingLogSeedling(string name, string parentCategory, string childCategory) { FileName = name; CategoryId = SeedCategories.GetCategoryId(parentCategory, childCategory); CraftingLogTypeId = SeedCommon.GetCraftingLogTypeIndex(name); }
public AchievementSeedling(string name, string category, string type) { FileName = name; CategoryId = SeedCategories.GetCategoryId(category); AchievementTypeId = SeedCommon.GetAchievementTypeId(type); }