Exemplo n.º 1
0
        private static void BulkInsert()
        {
            using (EntitiesModel context = new EntitiesModel())
            {
                List<Product> productsNew = new List<Product>();
                for (int i = 0; i < 1000; i++)
                {
                    productsNew.Add(new Product() { Discontinued = false, ProductName = "Product" + i });
                }

                context.Add(productsNew);
                context.SaveChanges();
            }
        }