Your approach is acceptable. The
Multiple items can be removed from the database using a procedure. Additionally, the approach you're using to acquire the remaining n goods is suitable. However
will only return entries that were most recently added to the database, in that order.
var lastN = MyDbContext.MyDbSet .OrderByDescending(g => g.Id) .Take(N); MyDbContext.MyDbSet.RemoveRange(lastN);