I have to delete all rows of a model with condition fkey_id = 1 What 's the better mode?
2 Answers
The fast way is to use batch commands in pure ADO.NET or a stored procedure.
Entity Framework does not support batch execution and deleting the records not attached to context.
The common way to delete using Entity Framework is to explicitly load the collection of objects associated with the fkey_id == 1 and call the delete method.