Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework - Transactions replacing SaveChanges(bool) with SaveChanges(SaveOptions)

This is a follow up question to Using Transactions or SaveChanges(false) and AcceptAllChanges()?

Specifically about this line context2.SaveChanges(false);

Now SaveChanges(bool) is deprecated. We are supposed to use SaveChanges(SaveOptions) instead.

The SaveOptions has following options:

  • None
  • AcceptAllChangesAfterSave
  • DetectChangesBeforeSave

Which of these map to SaveChanges(false)?

like image 271
dev.e.loper Avatar asked May 01 '12 21:05

dev.e.loper


1 Answers

SaveChanges(SaveOptions.DetectChangesBeforeSave) is equivalent of SaveChanges(false)

like image 61
Ladislav Mrnka Avatar answered Dec 07 '22 11:12

Ladislav Mrnka