private static void SeedData(HarrysDbContext context) { if (!context.Customers.Any(r => r.PersonNummer == "1212129999")) { context.Customers.Add(new Customer { Name = "Kajsa Anka", PersonNummer = "1212129999" }); context.SaveChanges(); } }
public static void Initialize(HarrysDbContext context) { //context.Database.EnsureCreated(); context.Database.Migrate(); SeedData(context); }