ABP8.1事务
protected readonly IUnitOfWorkManager _unitOfWorkManager;
public PlanningTaskManagerBase(IUnitOfWorkManager unitOfWorkManager)
{
_unitOfWorkManager = unitOfWorkManager;
}
using (var uow = _unitOfWorkManager.Begin()) { try {
…… } catch (Exception ex) { await uow.RollbackAsync(); // 回滚事务 } }