How to make a transaction in asp.net-core 2.0?

荒凉一梦 提交于 2019-12-24 12:14:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!