Ejemplo n.º 1
0
        public static void EnsureDataSeeded(this EcContext context)
        {
            var list = new List <Customer>()
            {
                new Customer()
                {
                    fstname = "Trần", lstname = "Tra", idCustomer = "1", phone = "0984518825",
                },
                new Customer()
                {
                    fstname = "Trần", lstname = "Tra", idCustomer = "2", phone = "0984518825"
                }
            };

            list.ForEach(p => context.Customers.Add(p));
            context.SaveChanges();
        }
Ejemplo n.º 2
0
 public static void EnsureDataDeleted(this EcContext context)
 {
     context.Database.EnsureDeleted();
 }