Add SimpleClient

This commit is contained in:
skx
2021-01-16 14:41:58 +08:00
parent 9299097e99
commit c05677740c
4 changed files with 12 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ namespace SqlSugar
bool InsertRange(List<T> insertObjs); bool InsertRange(List<T> insertObjs);
bool InsertRange(T[] insertObjs); bool InsertRange(T[] insertObjs);
int InsertReturnIdentity(T insertObj); int InsertReturnIdentity(T insertObj);
long InsertReturnBigIdentity(T insertObj);
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 Update(T updateObj); bool Update(T updateObj);
@@ -61,6 +62,7 @@ namespace SqlSugar
Task<bool> InsertRangeAsync(List<T> insertObjs); Task<bool> InsertRangeAsync(List<T> insertObjs);
Task<bool> InsertRangeAsync(T[] insertObjs); Task<bool> InsertRangeAsync(T[] insertObjs);
Task<int> InsertReturnIdentityAsync(T insertObj); Task<int> InsertReturnIdentityAsync(T insertObj);
Task<long> InsertReturnBigIdentityAsync(T insertObj);
Task<bool> IsAnyAsync(Expression<Func<T, bool>> whereExpression); Task<bool> IsAnyAsync(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);

View File

@@ -30,7 +30,7 @@ namespace SqlSugar
public override object FormatValue(object value) public override object FormatValue(object value)
{ {
var n = "N"; var n = "N";
if (this.Context.CurrentConnectionConfig.MoreSettings != null && this.Context.CurrentConnectionConfig.MoreSettings.MySqlDisableNarvchar) if (this.Context.CurrentConnectionConfig.MoreSettings != null && this.Context.CurrentConnectionConfig.MoreSettings.MySqlDisableNvarchar)
{ {
n = ""; n = "";
} }

View File

@@ -92,7 +92,7 @@ namespace SqlSugar
public override object FormatValue(object value) public override object FormatValue(object value)
{ {
var n = "N"; var n = "N";
if (this.Context.CurrentConnectionConfig.MoreSettings != null&&this.Context.CurrentConnectionConfig.MoreSettings.MySqlDisableNarvchar) if (this.Context.CurrentConnectionConfig.MoreSettings != null&&this.Context.CurrentConnectionConfig.MoreSettings.MySqlDisableNvarchar)
{ {
n = ""; n = "";
} }

View File

@@ -132,6 +132,10 @@ namespace SqlSugar
{ {
return this.Context.Insertable(insertObj).ExecuteReturnIdentity(); return this.Context.Insertable(insertObj).ExecuteReturnIdentity();
} }
public virtual long InsertReturnBigIdentity(T insertObj)
{
return this.Context.Insertable(insertObj).ExecuteReturnBigIdentity();
}
public virtual bool InsertRange(T[] insertObjs) public virtual bool InsertRange(T[] insertObjs)
{ {
return this.Context.Insertable(insertObjs).ExecuteCommand() > 0; return this.Context.Insertable(insertObjs).ExecuteCommand() > 0;
@@ -238,6 +242,10 @@ namespace SqlSugar
{ {
return this.Context.Insertable(insertObj).ExecuteReturnIdentityAsync(); return this.Context.Insertable(insertObj).ExecuteReturnIdentityAsync();
} }
public virtual Task<long> InsertReturnBigIdentityAsync(T insertObj)
{
return this.Context.Insertable(insertObj).ExecuteReturnBigIdentityAsync();
}
public virtual async Task<bool> InsertRangeAsync(T[] insertObjs) public virtual async Task<bool> InsertRangeAsync(T[] insertObjs)
{ {
return await this.Context.Insertable(insertObjs).ExecuteCommandAsync() > 0; return await this.Context.Insertable(insertObjs).ExecuteCommandAsync() > 0;