问题
I want to update some values but in case one fails I need to rollback. How can I do this in asp.net-core-2.0?
I have not found any answers yet. Is this because it is not yet supported? In that case what are some alternatives?
回答1:
Yes man, using System.Transactions.TransactionScope, available since .Net Core 2.0 and above. check this:
Using System.Transactions in ASP.NET: https://msdn.microsoft.com/en-us/ms229977
Implementing an Implicit Transaction using Transaction Scope: https://msdn.microsoft.com/en-us/ms172152
来源:https://stackoverflow.com/questions/46253570/how-to-make-a-transaction-in-asp-net-core-2-0