What is technical difference between SubmitChanges
in Linq-to-SQL and SaveChanges
in Entity Framework?
We know SubmitChanges
is a concept for DataContext
class while SaveChanges
is a method of ObjectContext
.
Are there any another differences?
Thanks
From MSDN:
SaveChanges operates within a transaction. SaveChanges will roll back that transaction and throw an exception if any of the dirty ObjectStateEntry objects cannot be persisted
SubmitChanges starts a transaction and will roll back if an exception occurs while SubmitChanges is executing. However, this does not roll back the changes in memory or tracked by the DataContext; those changes will need to be rolled back manually. You can start with a new instance of the DataContext if the changes in memory are to be discarded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With