This question is locked. New answers and comments are not allowed.
Hi there.
I a larger operataion I am using the bulk delete and later on the GetChanges to tell clients what happend. It seems the bulk deletes are not logged. Is that a flaw or by design? How can I get the deleted rows?
The code snippet:
01.
IQueryable<CalendarEvent> eventsToDelete = _db.CalendarEvents.Where(...);
02.
eventsToDelete.DeleteAll();
03.
// do some other stuff
04.
05.
// GetChanges
06.
ContextChanges contextChanges = _db.GetChanges();
07.
result.Created = contextChanges.GetInserts<CalendarEvent>();
08.
result.Updated = contextChanges.GetUpdates<CalendarEvent>();
09.
result.Deleted = contextChanges.GetDeletes<CalendarEvent>();
10.
11.
// the ids of the created rows are filled during SaveChanges
12.
_db.SaveChanges();