public static void CreateUsers(ShopContext context) { for (var i = 0; i < 200; i++) { context.Products.Add(new Product { Name = "Product" + i, Quantity = i + 1, Barcode = i.ToString() }); } context.SaveChanges(); }
public static void Initialize() { var context = new ShopContext(); if (context.Products.Any()) return; CreateUsers(context); }