Update SimpleClient

This commit is contained in:
sunkaixuan 2022-04-29 14:22:40 +08:00
parent e5931bf408
commit 29f07ecae7
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,7 @@ namespace SqlSugar
int Count(Expression<Func<T, bool>> whereExpression); int Count(Expression<Func<T, bool>> whereExpression);
bool Delete(Expression<Func<T, bool>> whereExpression); bool Delete(Expression<Func<T, bool>> whereExpression);
bool Delete(T deleteObj); bool Delete(T deleteObj);
bool Delete(List<T> deleteObjs);
bool DeleteById(dynamic id); bool DeleteById(dynamic id);
bool DeleteByIds(dynamic[] ids); bool DeleteByIds(dynamic[] ids);
T GetById(dynamic id); T GetById(dynamic id);
@ -55,6 +56,7 @@ namespace SqlSugar
Task<int> CountAsync(Expression<Func<T, bool>> whereExpression); Task<int> CountAsync(Expression<Func<T, bool>> whereExpression);
Task<bool> DeleteAsync(Expression<Func<T, bool>> whereExpression); Task<bool> DeleteAsync(Expression<Func<T, bool>> whereExpression);
Task<bool> DeleteAsync(T deleteObj); Task<bool> DeleteAsync(T deleteObj);
Task<bool> DeleteAsync(List<T> deleteObjs);
Task<bool> DeleteByIdAsync(dynamic id); Task<bool> DeleteByIdAsync(dynamic id);
Task<bool> DeleteByIdsAsync(dynamic[] ids); Task<bool> DeleteByIdsAsync(dynamic[] ids);
Task<T> GetByIdAsync(dynamic id); Task<T> GetByIdAsync(dynamic id);

View File

@ -200,6 +200,10 @@ namespace SqlSugar
{ {
return this.Context.Deleteable<T>().Where(deleteObj).ExecuteCommand() > 0; return this.Context.Deleteable<T>().Where(deleteObj).ExecuteCommand() > 0;
} }
public virtual bool Delete(List<T> deleteObjs)
{
return this.Context.Deleteable<T>().Where(deleteObjs).ExecuteCommand() > 0;
}
public virtual bool Delete(Expression<Func<T, bool>> whereExpression) public virtual bool Delete(Expression<Func<T, bool>> whereExpression)
{ {
return this.Context.Deleteable<T>().Where(whereExpression).ExecuteCommand() > 0; return this.Context.Deleteable<T>().Where(whereExpression).ExecuteCommand() > 0;
@ -314,6 +318,10 @@ namespace SqlSugar
{ {
return await this.Context.Deleteable<T>().Where(deleteObj).ExecuteCommandAsync() > 0; return await this.Context.Deleteable<T>().Where(deleteObj).ExecuteCommandAsync() > 0;
} }
public virtual async Task<bool> DeleteAsync(List<T> deleteObjs)
{
return await this.Context.Deleteable<T>().Where(deleteObjs).ExecuteCommandAsync() > 0;
}
public virtual async Task<bool> DeleteAsync(Expression<Func<T, bool>> whereExpression) public virtual async Task<bool> DeleteAsync(Expression<Func<T, bool>> whereExpression)
{ {
return await this.Context.Deleteable<T>().Where(whereExpression).ExecuteCommandAsync() > 0; return await this.Context.Deleteable<T>().Where(whereExpression).ExecuteCommandAsync() > 0;