What is the equivalent to:
DELETE * from ProductsCategories WHERE Product开发者_运维百科ID = 78
using entity framework 3.5sp1? Need to delete all categories that belongs to a product.
/M
I have used code similar to this to delete records.
var productCategories = from pc in context.ProductCatgories
where pc.ProductID == 78;
foreach(var category in productCategories)
{
context.DeleteObject(category);
}
context.SaveChanges();
精彩评论