public static void SeedDb(WebShopAppContext ctx) { ctx.Database.EnsureDeleted(); ctx.Database.EnsureCreated(); var product = ctx.Product.Add(new Product() { ProductName = "LadyShoes", Picture = "http://fp2w.org/assets/ext/blob.jpg", Gender = "Male", Type = "Glasses" }).Entity; var product2 = ctx.Product.Add(new Product() { ProductName = "Nighttime", Picture = "http://fp2w.org/assets/ext/blob.jpg" }).Entity; var product3 = ctx.Product.Add(new Product() { ProductName = "Hello" }).Entity; var product4 = ctx.Product.Add(new Product() { ProductName = "Bugger" }).Entity; ctx.Customer.Add(new Customer() { Name = "Heeeels", Products = product }); ctx.SaveChanges(); }
public CustomerRepository(WebShopAppContext ctx) { _ctx = ctx; }
public ProductRepository(WebShopAppContext ctx) { _ctx = ctx; }