Beispiel #1
0
        private static void CreateCard(WebTheCaoDbContext dbContext)
        {
            List <Card> Cards = new List <Card>
            {
                new Card {
                    Name   = "VietTel",
                    Status = true
                }
                , new Card {
                    Name = "Vinaphone",

                    Status = true
                },
                new Card
                {
                    Name = "Mobiphone",

                    Status = true
                },
            };

            Cards.ForEach(x => dbContext.Add(x));
            dbContext.SaveChanges();
        }
Beispiel #2
0
        private static void CreateMenhGia(WebTheCaoDbContext dbContext)
        {
            List <MenhGia> menhgia = new List <MenhGia>
            {
                new MenhGia {
                    Price      = 50000,
                    unit_Price = 45000,
                    Point      = 45000,
                }
                , new MenhGia {
                    Price      = 100000,
                    unit_Price = 45000,
                    Point      = 45000,
                },
                new MenhGia
                {
                    Price      = 200000,
                    unit_Price = 45000,
                    Point      = 45000,
                },

                new MenhGia
                {
                    Price      = 4000000,
                    unit_Price = 45000,
                    Point      = 45000,
                },
                new MenhGia
                {
                    Price      = 500000,
                    unit_Price = 45000,
                    Point      = 45000,
                }, new MenhGia {
                    Price      = 50000,
                    unit_Price = 45000,
                    Point      = 45000,
                }
                , new MenhGia {
                    Price      = 100000,
                    unit_Price = 45000,
                    Point      = 45000,
                },
                new MenhGia
                {
                    Price      = 200000,
                    unit_Price = 45000,
                    Point      = 45000,
                },

                new MenhGia
                {
                    Price      = 4000000,
                    unit_Price = 45000,
                    Point      = 45000,
                },
                new MenhGia
                {
                    Price      = 500000,
                    unit_Price = 45000,
                    Point      = 45000,
                },
            };

            menhgia.ForEach(x => dbContext.Add(x));
            dbContext.SaveChanges();
        }