示例#1
0
        public void Given預計ProductDb02Context的Product資料表應有(Table table)
        {
            var products = table.CreateSet <ModelInTest.Products>();

            using (var db = new ProductDb02Context())
            {
                db.Products.AddRange(products);
                db.SaveChanges();
            }
        }
示例#2
0
 public void As()
 {
     using (var db = new ProductDb01Context())
     {
         db.Database.ExecuteSqlCommand("Delete From dbo.Products");
     }
     using (var db = new ProductDb02Context())
     {
         db.Database.ExecuteSqlCommand("Delete From dbo.Products");
     }
 }