Entities Framework 4 doing a bulk delete

Posted by Adan on Stack Overflow See other posts from Stack Overflow or by Adan
Published on 2010-04-06T22:53:19Z Indexed on 2010/04/07 6:03 UTC
Read the original article Hit count: 302

Filed under:

I wish to know if there is a good way to do a bulk delete or delete multiple rows using the Entities Framework 4. I can't seam to find a DeleteAll command. The only one that is available is DeleteObject() which only takes one entity, I would like to perform a delete on a list of entities.Is there a better way than to loop trough the list? I did see an article that used ExecuteStoreQuery and created some sql that would perform the delete. Is there a better way than to perform any of these two options Please advice what is the best way to perform this action.

© Stack Overflow or respective owner

Related posts about entity-framework