mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
-
This commit is contained in:
@@ -8,13 +8,12 @@ namespace SqlSugar
|
||||
public class DeleteBuilder : IDMLBuilder
|
||||
{
|
||||
private List<string> _WhereInfos;
|
||||
|
||||
public EntityInfo EntityInfo { get; set; }
|
||||
public SqlSugarClient Context { get; set; }
|
||||
public ILambdaExpressions LambdaExpressions { get; set; }
|
||||
public List<SugarParameter> Parameters { get; set; }
|
||||
public StringBuilder sql { get; set; }
|
||||
public ISqlBuilder Builder { get; set; }
|
||||
public string TableName { get; set; }
|
||||
public string TableWithString { get; set; }
|
||||
public virtual List<string> WhereInfos
|
||||
{
|
||||
@@ -75,7 +74,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = Builder.GetTranslationTableName(TableName);
|
||||
var result = Builder.GetTranslationTableName(EntityInfo.EntityName);
|
||||
result += PubConst.Space;
|
||||
if (this.TableWithString.IsValuable())
|
||||
{
|
||||
|
@@ -22,8 +22,9 @@ namespace SqlSugar
|
||||
}
|
||||
public int ExecuteCommand()
|
||||
{
|
||||
DeleteBuilder.EntityInfo = this.Context.EntityProvider.GetEntityInfo<T>();
|
||||
string sql = DeleteBuilder.ToSqlString();
|
||||
var paramters = DeleteBuilder.Parameters.ToArray();
|
||||
var paramters = DeleteBuilder.Parameters==null?null:DeleteBuilder.Parameters.ToArray();
|
||||
return Db.GetInt(sql, paramters);
|
||||
}
|
||||
|
||||
@@ -105,6 +106,7 @@ namespace SqlSugar
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public IDeleteable<T> In<PkType>(List<PkType> primaryKeyValues)
|
||||
{
|
||||
if (primaryKeyValues == null || primaryKeyValues.Count() == 0)
|
||||
@@ -114,6 +116,7 @@ namespace SqlSugar
|
||||
}
|
||||
return In<PkType>(primaryKeyValues.ToArray());
|
||||
}
|
||||
|
||||
public IDeleteable<T> In<PkType>(PkType[] primaryKeyValues)
|
||||
{
|
||||
if (primaryKeyValues == null || primaryKeyValues.Count() == 0)
|
||||
@@ -143,7 +146,7 @@ namespace SqlSugar
|
||||
|
||||
public KeyValuePair<string, List<SugarParameter>> ToSql()
|
||||
{
|
||||
DeleteBuilder.TableName = this.Context.EntityProvider.GetTableName<T>();
|
||||
DeleteBuilder.EntityInfo = this.Context.EntityProvider.GetEntityInfo<T>();
|
||||
string sql = DeleteBuilder.ToSqlString();
|
||||
var paramters = DeleteBuilder.Parameters == null ? null : DeleteBuilder.Parameters.ToList();
|
||||
return new KeyValuePair<string, List<SugarParameter>>(sql, paramters);
|
||||
|
@@ -124,6 +124,7 @@ namespace SqlSugar
|
||||
}
|
||||
internal void Init()
|
||||
{
|
||||
InsertBuilder.EntityInfo = this.EntityInfo;
|
||||
Check.Exception(InsertObjs == null || InsertObjs.Count() == 0, "InsertObjs is null");
|
||||
int i = 0;
|
||||
foreach (var item in InsertObjs)
|
||||
|
@@ -253,7 +253,6 @@ namespace SqlSugar
|
||||
sqlBuilder.InsertBuilder.LambdaExpressions = InstanceFactory.GetLambdaExpressions(base.CurrentConnectionConfig);
|
||||
sqlBuilder.Context = reval.SqlBuilder.InsertBuilder.Context = this;
|
||||
reval.Init();
|
||||
reval.InsertBuilder.EntityInfo = reval.EntityInfo;
|
||||
return reval;
|
||||
}
|
||||
public virtual IInsertable<T> Insertable<T>(List<T> insertObjs) where T : class, new()
|
||||
|
Reference in New Issue
Block a user