How can I undo changes when a SaveChanges() doesn't succeed ?
contextObject.Toto.AddObject( new Toto());
try
{
contextObject.SaveChanges();
}
catch
{
// Undo changes !
}
In this sample, I'd like to remove the new Toto object in memory. I don't want to remove it manually. I'd like to synchronize my contextObject to my database.