Ejemplo n.º 1
0
 public void Bs()
 {
     using (var db = new ProductDb01Context())
     {
         db.Database.ExecuteSqlCommand("Delete From dbo.Products");
     }
 }
Ejemplo n.º 2
0
        public void Given預計ProductDb01Context的Product資料表應有(Table table)
        {
            var products = table.CreateSet <ModelInTest.Products>();

            using (var db = new ProductDb01Context())
            {
                db.Products.AddRange(products);
                db.SaveChanges();
            }
        }