2010-02-12 122 views

回答

2

我用類似這樣的刪除記錄的代碼。

var productCategories = from pc in context.ProductCatgories 
    where pc.ProductID == 78; 
foreach(var category in productCategories) 
{ 
    context.DeleteObject(category); 
} 

context.SaveChanges();