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