Beispiel #1
0
        //HW3

        public void Insert100000EntitiesInDB()
        {
            using (var context = new EntitiesModel())
            {
                ulong id = 1;
                int counter = 0;
                while (counter < 100000)
                {
                    id += 7;
                    var row = new OpenAccessDemoEntity()
                    {
                        Name = id + "Demo"
                    };

                    context.Add(row);

                    counter += 1;
                    context.SaveChanges();
                }
            }
        }
Beispiel #2
0
        public void NormalDelete()
        {
            using (var context = new EntitiesModel())
            {
                foreach (var item in context.OpenAccessDemoEntities)
                {
                    context.Delete(item);
                }

                context.SaveChanges();
            }
        }