How to solve the problem that multiple data updates in EFCore cannot be savechanges () at the same time.
This article mainly explains "how to solve the problem that multiple data updates in EFCore can not be savechanges () at the same time". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve the problem that multiple data updates in EFCore cannot be savechanges () at the same time".
1 add var transaction = ctx.Database.BeginTransaction () under the definition of ModelContext
1.2 add transaction.Commit () after the last SaveChanges ()
3 add transaction.Rollback () to the if (sMsgCode! = "") branch of finally; add transaction.Dispose () at the end
Thank you for reading, the above is the content of "how to solve the problem that multiple data updates in EFCore cannot be savechanges () at the same time". After the study of this article, I believe you have a deeper understanding of how to solve the problem that multiple data updates in EFCore cannot be savechanges () at the same time, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!