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
?
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?
Yes, you can do this. From this tip:
See the full tip for details and complications.