批量删除的LINQ到实体 [英] Bulk-deleting in LINQ to Entities

查看:142
本文介绍了批量删除的LINQ到实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法来批量删除一堆匹配LINQ或LINQ到实体给定查询的对象?我能找到的唯一引用是过时的,而且似乎愚蠢的迭代和手动删除我希望删除的所有对象。

Is there any way to bulk-delete a bunch of objects matching a given query in LINQ or LINQ-to-Entities? The only references that I can find are outdated, and it seems silly to iterate over and manually delete all objects I wish to remove.

推荐答案

现在的问题是一个古老(从EF5存在之前)。对于谁在使用EF5人, EntityFramework.Extended 这是否在一个单元。

The question is an old one (from before EF5 existed). For anyone who's using EF5, EntityFramework.Extended does this in a snap.

这篇关于批量删除的LINQ到实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆