mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-09 02:44:58 +08:00
Add SimpleClient
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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 = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user