- 增加 IInsertOrUpdate.SetSource(sql) 重载方法;

This commit is contained in:
2881099
2022-08-17 19:49:54 +08:00
parent 4829df9573
commit e12f6e04a2
26 changed files with 245 additions and 76 deletions

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
namespace FreeSql.Sqlite.Curd
{
@ -14,6 +15,15 @@ namespace FreeSql.Sqlite.Curd
{
}
public override IInsertOrUpdate<T1> SetSource(string sql, Expression<Func<T1, object>> tempPrimarys = null)
{
var list = _orm.Ado.CommandFluent(sql)
.WithConnection(_connection)
.WithTransaction(_transaction)
.Query<T1>();
return SetSource(list, tempPrimarys);
}
public override string ToSql()
{
if (_source?.Any() != true) return null;