mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Add UpdateSetColumnsTrue
This commit is contained in:
parent
71bc2a7293
commit
b151954571
@ -49,6 +49,7 @@ namespace SqlSugar
|
||||
|
||||
bool IsAny(Expression<Func<T, bool>> whereExpression);
|
||||
bool Update(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
|
||||
bool UpdateSetColumnsTrue(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
|
||||
bool Update(T updateObj);
|
||||
bool UpdateRange(List<T> updateObjs);
|
||||
bool UpdateRange(T[] updateObjs);
|
||||
@ -83,6 +84,7 @@ namespace SqlSugar
|
||||
Task<T> InsertReturnEntityAsync(T insertObj);
|
||||
|
||||
Task<bool> IsAnyAsync(Expression<Func<T, bool>> whereExpression);
|
||||
Task<bool> UpdateSetColumnsTrueAsync(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
|
||||
Task<bool> UpdateAsync(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
|
||||
Task<bool> UpdateAsync(T updateObj);
|
||||
Task<bool> UpdateRangeAsync(List<T> updateObjs);
|
||||
|
@ -212,6 +212,10 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.Updateable<T>().SetColumns(columns).Where(whereExpression).ExecuteCommand() > 0;
|
||||
}
|
||||
public virtual bool UpdateSetColumnsTrue(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression)
|
||||
{
|
||||
return this.Context.Updateable<T>().SetColumns(columns,true).Where(whereExpression).ExecuteCommand() > 0;
|
||||
}
|
||||
public virtual bool Delete(T deleteObj)
|
||||
{
|
||||
return this.Context.Deleteable<T>().Where(deleteObj).ExecuteCommand() > 0;
|
||||
@ -342,6 +346,10 @@ namespace SqlSugar
|
||||
{
|
||||
return await this.Context.Updateable<T>().SetColumns(columns).Where(whereExpression).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
public virtual async Task<bool> UpdateSetColumnsTrueAsync(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression)
|
||||
{
|
||||
return await this.Context.Updateable<T>().SetColumns(columns,true).Where(whereExpression).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
public virtual async Task<bool> DeleteAsync(T deleteObj)
|
||||
{
|
||||
return await this.Context.Deleteable<T>().Where(deleteObj).ExecuteCommandAsync() > 0;
|
||||
|
Loading…
Reference in New Issue
Block a user