static void Main(string[] args) { ProductDBContext context = new ProductDBContext(); var product = context.Products; var product1 = product.Add(new Product() { ProductID = 1, Name = "Badam", Price = 99.90, Quantity = "250ml", CategoryID = 1 }); var product2 = product.Add(new Product() { ProductID = 2, Name = "Coffee", Price = 89.90, Quantity = "250ml", CategoryID = 2 }); var product3 = product.Add(new Product() { ProductID = 3, Name = "Cold Coffee", Price = 79.90, Quantity = "550ml", CategoryID = 3 }); var Category = context.Categories; var Category1 = Category.Add(new category() { CategoryID = 3, Name = "Orange mint" }); var Category2 = Category.Add(new category() { CategoryID = 3, Name = "Lemon mint" }); context.SaveChanges(); }
static void Main(string[] args) { ProductDBContext context = new ProductDBContext(); var product = context.Products; var product1 = context.Products.Add(new Product() { ProductID = 1, Name = "badam Drink", Price = 99.99, Quantity = "500 ml", CategoryID = 1 }); var product2 = context.Products.Add(new Product() { ProductID = 2, Name = "Coffe Drink", Price = 59.99, Quantity = "250 ml", CategoryID = 1 }); var product3 = context.Products.Add(new Product() { ProductID = 3, Name = "Coke Drink", Price = 49.99, Quantity = "200 ml", CategoryID = 1 }); var categories = context.Categories; var category1 = categories.Add(new Category() { CategoryID = 1, Name = " Beverages", }); context.SaveChanges(); }