mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Upadte db.Queryable<T>().TranLock
This commit is contained in:
@@ -422,8 +422,9 @@ namespace SqlSugar
|
||||
_WhereClassByPrimaryKey(new List<T>() { data });
|
||||
return this;
|
||||
}
|
||||
public ISugarQueryable<T> TranLock(DbLockType LockType = DbLockType.Wait)
|
||||
public ISugarQueryable<T> TranLock(DbLockType? LockType = DbLockType.Wait)
|
||||
{
|
||||
if (LockType == null) return this;
|
||||
Check.ExceptionEasy(this.Context.Ado.Transaction == null, "need BeginTran", "需要事务才能使用TranLock");
|
||||
Check.ExceptionEasy(this.QueryBuilder.IsSingle()==false, "TranLock, can only be used for single table query", "TranLock只能用在单表查询");
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.SqlServer)
|
||||
|
@@ -58,7 +58,7 @@ namespace SqlSugar
|
||||
ISugarQueryable<T> WhereColumns(List<Dictionary<string, object>> columns);
|
||||
ISugarQueryable<T> WhereColumns(Dictionary<string, object> columns, bool ignoreDefaultValue);
|
||||
ISugarQueryable<T> WhereColumns(Dictionary<string, object> columns);
|
||||
ISugarQueryable<T> TranLock(DbLockType LockType = DbLockType.Wait);
|
||||
ISugarQueryable<T> TranLock(DbLockType? LockType = DbLockType.Wait);
|
||||
ISugarQueryable<T> Where(Expression<Func<T, bool>> expression);
|
||||
ISugarQueryable<T> Where(string whereString, object parameters = null);
|
||||
ISugarQueryable<T> Where(List<IConditionalModel> conditionalModels);
|
||||
|
Reference in New Issue
Block a user