entity framework开发模式,如何直接使用entity sql语句。比如以下代码,进行批量删除的话,很耗资源,有什么办法直接使用entity sql来进行删除吗?
比如直接使用 Delete from products where name = @name之类的,谢谢。
 using (EntityDataContext context = new EntityDataContext ())
{
var query = from p in context.Products
            where p.name == name
            select p;
foreach(var item in query)
{
     context.DeleteObject(item);
}
     context.SaveChange();}