ABP8.1事务

protected readonly IUnitOfWorkManager _unitOfWorkManager;
public PlanningTaskManagerBase(IUnitOfWorkManager unitOfWorkManager)
{
 _unitOfWorkManager = unitOfWorkManager;
}

using
(var uow = _unitOfWorkManager.Begin()) { try {
…… }
catch (Exception ex) { await uow.RollbackAsync(); // 回滚事务 } }

 

posted @ 2024-09-30 17:49  韩梦芫  阅读(10)  评论(0编辑  收藏  举报