频繁的使用Storageable 操作同一条数据会导致表死锁原因是什么 返回
SqlSugar
待处理
138
冲冲冲 发布于1周前
悬赏:5 飞吻
var item = new CacheEntity { userId = userId, moduleKey = moduleKey, cacheValue = cacheValue };
var result = await _repo.Context.Storageable(item)
.WhereColumns(it => new { it.userId, it.moduleKey }) // 指定条件,插入还是更新
.TranLock(DbLockType.Wait).ExecuteCommandAsync() > 0;