在 LINQ to Entities 中批量删除 [英] Bulk-deleting in LINQ to Entities

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

问题描述

有什么方法可以批量删除与 LINQ 或 LINQ-to-Entities 中的给定查询匹配的一堆对象?我能找到的唯一引用已经过时,迭代并手动删除所有我想删除的对象似乎很愚蠢.

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 to Entities 中批量删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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