Hi,
i have a weird case and not sure what is causing it.
the code below runs DeleteMulti with no problem but skips SaveMulti for some reason.
var trans = new Transaction(IsolationLevel.ReadCommitted, "UpdateGradesForStudent");
int classId = Convert.ToInt32(this.Page.Request["classId"]);
int studentId = Convert.ToInt32(this.Page.Request["studentId"]);
GradeBookCollection toDelete = this.CollectEntitiesToDelete(classId, studentId: studentId);
GradeBookCollection toAdd = this.CollectEntitiesToAdd(classId, studentId: studentId);
trans.Add(toDelete);
trans.Add(toAdd);
toDelete.DeleteMulti();
toAdd.SaveMulti();
trans.Commit();
I call this in a try catch statement and it runs with no exception but even though there are like 20 entities in toAdd collection, none is saved in.
All items in toDelete are deleted but nothing will be added.
If i remove the transaction it works just fine. Deletes are done first, then the inserts are persisted.
Am i missing something here?
thanks