I understand I can map a delete stored procedure to the delete method for a particular type.
However, this requires passing in a retrieved object to my context's DeleteObject
method.
This is bad enough, but what if I want to delete 2000 rows? Can I do this with Linq to Entities without first retrieving those 2000 rows from the database and going through a loop calling DeleteObject
?
Edit:
If such functionality does not exist in Linq to Entities, and you know this to be the case, then please just say so and I'll investigate other options!
If it doesn't directly exist, could I achieve is by piping a Stored Proc through Linq to Entities?
Edit 2:
Uh oh. I think I've spotted a dupe:
http://stackoverflow.com/questions/869209/bulk-deleting-in-linq-to-entities