mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 20:43:46 +08:00
Update queryable.IntoTable
This commit is contained in:
@@ -756,7 +756,6 @@ namespace SqlSugar
|
|||||||
var name = this.SqlBuilder.GetTranslationTableName(entityInfo.DbTableName);
|
var name = this.SqlBuilder.GetTranslationTableName(entityInfo.DbTableName);
|
||||||
return IntoTable(TableEntityType, name);
|
return IntoTable(TableEntityType, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int IntoTable(Type TableEntityType,string TableName)
|
public int IntoTable(Type TableEntityType,string TableName)
|
||||||
{
|
{
|
||||||
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
||||||
|
@@ -674,5 +674,28 @@ ParameterT parameter)
|
|||||||
var list = await this.ToListAsync();
|
var list = await this.ToListAsync();
|
||||||
return GetChildList(parentIdExpression, pk, list, primaryKeyValue, isContainOneself);
|
return GetChildList(parentIdExpression, pk, list, primaryKeyValue, isContainOneself);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Task<int> IntoTableAsync<TableEntityType>(CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
return IntoTableAsync(typeof(TableEntityType));
|
||||||
|
}
|
||||||
|
public Task<int> IntoTableAsync<TableEntityType>(string TableName, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
return IntoTableAsync(typeof(TableEntityType), TableName, cancellationToken );
|
||||||
|
}
|
||||||
|
public Task<int> IntoTableAsync(Type TableEntityType, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var entityInfo = this.Context.EntityMaintenance.GetEntityInfo(TableEntityType);
|
||||||
|
var name = this.SqlBuilder.GetTranslationTableName(entityInfo.DbTableName);
|
||||||
|
return IntoTableAsync(TableEntityType, name);
|
||||||
|
}
|
||||||
|
public async Task<int> IntoTableAsync(Type TableEntityType, string TableName, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
||||||
|
string sql;
|
||||||
|
OutIntoTableSql(TableName, out sqlInfo, out sql);
|
||||||
|
return await this.Context.Ado.ExecuteCommandAsync(sql, sqlInfo.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -182,6 +182,12 @@ namespace SqlSugar
|
|||||||
int IntoTable(Type TableEntityType);
|
int IntoTable(Type TableEntityType);
|
||||||
int IntoTable<TableEntityType>(string tableName);
|
int IntoTable<TableEntityType>(string tableName);
|
||||||
int IntoTable(Type TableEntityType,string tableName);
|
int IntoTable(Type TableEntityType,string tableName);
|
||||||
|
|
||||||
|
Task<int> IntoTableAsync<TableEntityType>(CancellationToken cancellationToken = default);
|
||||||
|
Task<int> IntoTableAsync(Type TableEntityType, CancellationToken cancellationToken = default);
|
||||||
|
Task<int> IntoTableAsync<TableEntityType>(string tableName, CancellationToken cancellationToken = default);
|
||||||
|
Task<int> IntoTableAsync(Type TableEntityType, string tableName, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
//bool IntoTable(Type TableEntityType, params string[] columnNameList);
|
//bool IntoTable(Type TableEntityType, params string[] columnNameList);
|
||||||
//bool IntoTable<TableEntityType>(params string[] columnNameList);
|
//bool IntoTable<TableEntityType>(params string[] columnNameList);
|
||||||
List<T> SetContext<ParameterT>(Expression<Func<T, bool>> whereExpression, ParameterT parameter);
|
List<T> SetContext<ParameterT>(Expression<Func<T, bool>> whereExpression, ParameterT parameter);
|
||||||
|
Reference in New Issue
Block a user