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