mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-29 18:04:41 +08:00
Update Core
This commit is contained in:
Binary file not shown.
@@ -484,9 +484,22 @@ namespace SqlSugar
|
||||
}
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
DiffLogTableInfo diffTable = new DiffLogTableInfo();
|
||||
diffTable.TableName = this.EntityInfo.DbTableName;
|
||||
diffTable.TableDescription = this.EntityInfo.TableDescription;
|
||||
diffTable.Columns = this.EntityInfo.Columns.Where(it => it.IsIgnore == false).Select(it => new DiffLogColumnInfo()
|
||||
{
|
||||
ColumnDescription = it.ColumnDescription,
|
||||
ColumnName = it.DbColumnName,
|
||||
Value = it.PropertyInfo.GetValue(this.InsertObjs.Last(), null)
|
||||
}).ToList();
|
||||
return new List<DiffLogTableInfo>() { diffTable };
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,7 @@ namespace SqlSugar
|
||||
{
|
||||
return 150;
|
||||
}
|
||||
else if (this.Context is OracleExpressionContext)
|
||||
{
|
||||
else if (this.Context is OracleExpressionContext) {
|
||||
|
||||
return 401;
|
||||
}
|
||||
@@ -62,10 +61,6 @@ namespace SqlSugar
|
||||
{
|
||||
return (HasWhere?"AND":"WHERE")+ " ROWNUM=1";
|
||||
}
|
||||
else if (this.Context is PostgreSQLExpressionContext)
|
||||
{
|
||||
return "limit 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "limit 0,1";
|
||||
|
||||
@@ -364,6 +364,10 @@ namespace SqlSugar
|
||||
{
|
||||
item.Length = 50;
|
||||
}
|
||||
if (item.DataType == "varchar" && item.Length == 0)
|
||||
{
|
||||
item.Length = 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
string sql = GetCreateTableSql(tableName, columns);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.Insertable(insertObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
public bool InsertRange<T>(List<T>[] insertObjs) where T : class, new()
|
||||
public bool InsertRange<T>(List<T> insertObjs) where T : class, new()
|
||||
{
|
||||
return this.Context.Insertable(insertObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
@@ -92,6 +92,10 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.Updateable(updateObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
public bool UpdateRange<T>(List<T> updateObjs) where T : class, new()
|
||||
{
|
||||
return this.Context.Updateable(updateObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
public bool Update<T>(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression) where T : class, new()
|
||||
{
|
||||
return this.Context.Updateable<T>().UpdateColumns(columns).Where(whereExpression).ExecuteCommand() > 0;
|
||||
@@ -193,7 +197,7 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.Insertable(insertObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
public bool InsertRange(List<T>[] insertObjs)
|
||||
public bool InsertRange(List<T> insertObjs)
|
||||
{
|
||||
return this.Context.Insertable(insertObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
@@ -205,6 +209,10 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.Updateable(updateObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
public bool UpdateRange(List<T> updateObjs)
|
||||
{
|
||||
return this.Context.Updateable(updateObjs).ExecuteCommand() > 0;
|
||||
}
|
||||
public bool Update(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression)
|
||||
{
|
||||
return this.Context.Updateable<T>().UpdateColumns(columns).Where(whereExpression).ExecuteCommand() > 0;
|
||||
|
||||
Reference in New Issue
Block a user