Reputation: 5504
What's the easiest way to delete rows in a database table using Entity Framework 6?
I just pulled down EF6 via NuGet and have been able to successfully query rows from the DB. However, I do not seem to have access to the context.<entity>.Delete()
or context.<entity>.DeleteObject()
methods, which are most often shown as examples online.
Upvotes: 0
Views: 190
Reputation: 5504
Got it working.
var query = <linq query>;
context.<entity>.RemoveRange(query);
context.SaveChanges();
Upvotes: 1