- 增加 ISelect.InsertInto 将查询转换为 INSERT INTO t1 SELECT ... FROM t2 执行插入;#469

This commit is contained in:
28810
2020-10-16 22:01:00 +08:00
parent fc47407fba
commit acf26ecbef
46 changed files with 638 additions and 191 deletions

View File

@@ -392,6 +392,8 @@ namespace FreeSql.Internal.CommonProvider
public override List<T1> ToList(bool includeNestedMembers = false) => base.ToList(_isIncluded || includeNestedMembers);
public int InsertInto<TTargetEntity>(string tableName, Expression<Func<T1, TTargetEntity>> select) where TTargetEntity : class => base.InternalInsertInto<TTargetEntity>(tableName, select);
bool _isIncluded = false;
public ISelect<T1> Include<TNavigate>(Expression<Func<T1, TNavigate>> navigateSelector) where TNavigate : class
{
@@ -1253,6 +1255,8 @@ namespace FreeSql.Internal.CommonProvider
}
public Task<List<TDto>> ToListAsync<TDto>() => ToListAsync(GetToListDtoSelector<TDto>());
public Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<T1, TTargetEntity>> select) where TTargetEntity : class => base.InternalInsertIntoAsync<TTargetEntity>(tableName, select);
public Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<T1, TReturn>> select)
{
if (select == null) return this.InternalToDataTableAsync(select?.Body);