Update SimpleClient

This commit is contained in:
sunkaixuna
2021-07-31 21:38:05 +08:00
parent a4a5e89485
commit eaf297edc0
2 changed files with 23 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ namespace SqlSugar
bool InsertRange(T[] insertObjs);
int InsertReturnIdentity(T insertObj);
long InsertReturnBigIdentity(T insertObj);
long InsertReturnSnowflakeId(T insertObj);
List<long> InsertReturnSnowflakeId(List<T> insertObjs);
bool IsAny(Expression<Func<T, bool>> whereExpression);
bool Update(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
bool Update(T updateObj);
@@ -64,6 +68,9 @@ namespace SqlSugar
Task<bool> InsertRangeAsync(T[] insertObjs);
Task<int> InsertReturnIdentityAsync(T insertObj);
Task<long> InsertReturnBigIdentityAsync(T insertObj);
Task<long> InsertReturnSnowflakeIdAsync(T insertObj);
Task<List<long>> InsertReturnSnowflakeIdAsync(List<T> insertObjs);
Task<bool> IsAnyAsync(Expression<Func<T, bool>> whereExpression);
Task<bool> UpdateAsync(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
Task<bool> UpdateAsync(T updateObj);

View File

@@ -148,6 +148,22 @@ namespace SqlSugar
{
return this.Context.Insertable(insertObj).ExecuteReturnBigIdentity();
}
public virtual long InsertReturnSnowflakeId(T insertObj)
{
return this.Context.Insertable(insertObj).ExecuteReturnSnowflakeId();
}
public virtual List<long> InsertReturnSnowflakeId(List<T> insertObjs)
{
return this.Context.Insertable(insertObjs).ExecuteReturnSnowflakeIdList();
}
public virtual Task<long> InsertReturnSnowflakeIdAsync(T insertObj)
{
return this.Context.Insertable(insertObj).ExecuteReturnSnowflakeIdAsync();
}
public virtual Task<List<long>> InsertReturnSnowflakeIdAsync(List<T> insertObjs)
{
return this.Context.Insertable(insertObjs).ExecuteReturnSnowflakeIdListAsync();
}
public virtual bool InsertRange(T[] insertObjs)
{
return this.Context.Insertable(insertObjs).ExecuteCommand() > 0;